Make the broker timeout when sharding configurable
This is a bit of a blunt tool -- might be better to do a temporary boost when recording progress, based on the amount of time spent *making* that progress like in manage_shard_ranges -- but I definitely *don't* want to get through a 4 hour cleave and then *fail to record that*. Default to 60s, which is more than twice the default timeout, but give operators the option to set it as they like. Change-Id: If518d503b0995051f7dafcbb73ac3c9889fe450f
This commit is contained in:
parent
7eb60b4cd6
commit
33ee15b8aa
@ -417,3 +417,8 @@ use = egg:swift#xprofile
|
|||||||
# limit may be changed by setting recon_candidates_limit to an integer value. A
|
# limit may be changed by setting recon_candidates_limit to an integer value. A
|
||||||
# negative value implies no limit.
|
# negative value implies no limit.
|
||||||
# recon_candidates_limit = 5
|
# recon_candidates_limit = 5
|
||||||
|
#
|
||||||
|
# Large databases tend to take a while to work with, but we want to make sure
|
||||||
|
# we write down our progress. Use a larger-than-normal broker timeout to make
|
||||||
|
# us less likely to bomb out on a LockTimeout.
|
||||||
|
# broker_timeout = 60
|
||||||
|
@ -141,6 +141,8 @@ class ContainerSharder(ContainerReplicator):
|
|||||||
self.auto_shard = config_true_value(conf.get('auto_shard', False))
|
self.auto_shard = config_true_value(conf.get('auto_shard', False))
|
||||||
self.recon_candidates_limit = int(
|
self.recon_candidates_limit = int(
|
||||||
conf.get('recon_candidates_limit', 5))
|
conf.get('recon_candidates_limit', 5))
|
||||||
|
self.broker_timeout = config_positive_int_value(
|
||||||
|
conf.get('broker_timeout', 60))
|
||||||
|
|
||||||
# internal client
|
# internal client
|
||||||
self.conn_timeout = float(conf.get('conn_timeout', 5))
|
self.conn_timeout = float(conf.get('conn_timeout', 5))
|
||||||
@ -978,7 +980,8 @@ class ContainerSharder(ContainerReplicator):
|
|||||||
node_id)
|
node_id)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
broker = ContainerBroker(path, logger=self.logger)
|
broker = ContainerBroker(path, logger=self.logger,
|
||||||
|
timeout=self.broker_timeout)
|
||||||
error = None
|
error = None
|
||||||
try:
|
try:
|
||||||
self._identify_sharding_candidate(broker, node)
|
self._identify_sharding_candidate(broker, node)
|
||||||
|
Loading…
Reference in New Issue
Block a user