BUGFIX: dcs configuration need to be updated from dcs...

loop_wait and ttl is configured cluster-wide via config key stored in
DCS. Depending on values of these parameters we are configuring
different kind of timeouts used in DCS controllers.
In order to fetch this configuration we first need to create DCS
controller and only after apply parameters...
This commit is contained in:
Alexander Kukushkin
2016-08-31 15:08:31 +02:00
parent 4d72eef164
commit 0e8220f9f2
+4 -2
View File
@@ -38,9 +38,11 @@ class Patroni(object):
try: try:
cluster = self.dcs.get_cluster() cluster = self.dcs.get_cluster()
if cluster and cluster.config: if cluster and cluster.config:
self.config.set_dynamic_configuration(cluster.config) if self.config.set_dynamic_configuration(cluster.config):
self.dcs.reload_config(self.config)
elif not self.config.dynamic_configuration and 'bootstrap' in self.config: elif not self.config.dynamic_configuration and 'bootstrap' in self.config:
self.config.set_dynamic_configuration(self.config['bootstrap']['dcs']) if self.config.set_dynamic_configuration(self.config['bootstrap']['dcs']):
self.dcs.reload_config(self.config)
break break
except DCSError: except DCSError:
logger.warning('Can not get cluster from dcs') logger.warning('Can not get cluster from dcs')