summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-09-30 20:55:33 +0000
committerGerrit Code Review <review@openstack.org>2014-09-30 20:55:33 +0000
commit08b2bc1b2aa622a90dbd2de3b265ee62dc57d7f2 (patch)
tree10da5d9c23bc4b77c81d959588807ec4c2457322
parent2a6fc357bfb91c23214e94b39613e7344bb6a93c (diff)
parent0fe9c9dd59cf4bc084a9875ce789f0b2943c799a (diff)
downloadtrove-08b2bc1b2aa622a90dbd2de3b265ee62dc57d7f2.tar.gz
Merge "Make the replication snapshot timeout configurable"
-rw-r--r--etc/trove/trove-taskmanager.conf.sample1
-rw-r--r--trove/common/cfg.py3
-rw-r--r--trove/common/utils.py2
-rw-r--r--trove/guestagent/api.py3
4 files changed, 7 insertions, 2 deletions
diff --git a/etc/trove/trove-taskmanager.conf.sample b/etc/trove/trove-taskmanager.conf.sample
index f7046319..89f43426 100644
--- a/etc/trove/trove-taskmanager.conf.sample
+++ b/etc/trove/trove-taskmanager.conf.sample
@@ -134,6 +134,7 @@ trove_security_group_rule_cidr = 0.0.0.0/0
agent_heartbeat_time = 10
agent_call_low_timeout = 5
agent_call_high_timeout = 150
+agent_replication_snapshot_timeout = 36000
# Whether to use nova's contrib api for create server with volume
use_nova_server_volume = False
diff --git a/trove/common/cfg.py b/trove/common/cfg.py
index 6d77e0f6..d627c250 100644
--- a/trove/common/cfg.py
+++ b/trove/common/cfg.py
@@ -139,6 +139,9 @@ common_opts = [
cfg.IntOpt('agent_call_high_timeout', default=60,
help="Maximum time (in seconds) to wait for Guest Agent 'slow' "
"requests (such as restarting the database)."),
+ cfg.IntOpt('agent_replication_snapshot_timeout', default=36000,
+ help='Maximum time (in seconds) to wait for taking a Guest '
+ 'Agent replication snapshot.'),
# The guest_id opt definition must match the one in cmd/guest.py
cfg.StrOpt('guest_id', default=None, help="ID of the Guest Instance."),
cfg.IntOpt('state_change_wait_time', default=3 * 60,
diff --git a/trove/common/utils.py b/trove/common/utils.py
index a27cd8d8..2f05aee7 100644
--- a/trove/common/utils.py
+++ b/trove/common/utils.py
@@ -250,7 +250,7 @@ def poll_until(retriever, condition=lambda value: value,
obj = retriever()
if condition(obj):
raise LoopingCallDone(retvalue=obj)
- if time_out is not None and time.time() > start_time + time_out:
+ if time_out is not None and time.time() - start_time > time_out:
raise exception.PollTimeOut
lc = LoopingCall(f=poll_and_check).start(sleep_time, True)
return lc.wait()
diff --git a/trove/guestagent/api.py b/trove/guestagent/api.py
index 3e712ccf..bdefa8fe 100644
--- a/trove/guestagent/api.py
+++ b/trove/guestagent/api.py
@@ -33,6 +33,7 @@ CONF = cfg.CONF
LOG = logging.getLogger(__name__)
AGENT_LOW_TIMEOUT = CONF.agent_call_low_timeout
AGENT_HIGH_TIMEOUT = CONF.agent_call_high_timeout
+AGENT_SNAPSHOT_TIMEOUT = CONF.agent_replication_snapshot_timeout
RPC_API_VERSION = "1.0"
@@ -326,7 +327,7 @@ class API(proxy.RpcProxy):
def get_replication_snapshot(self, snapshot_info=None):
LOG.debug("Retrieving replication snapshot from instance %s.", self.id)
- return self._call("get_replication_snapshot", AGENT_HIGH_TIMEOUT,
+ return self._call("get_replication_snapshot", AGENT_SNAPSHOT_TIMEOUT,
snapshot_info=snapshot_info)
def attach_replication_slave(self, snapshot, slave_config=None):