Commit 0779e3aa authored by Iustin Pop's avatar Iustin Pop
Browse files

Only update ssconf on cluster serial change

There is no need to update ssconf if the cluster serial number has not
changed.

Reviewed-by: ultrotter
parent 9fbfbb7b
......@@ -802,6 +802,9 @@ class ConfigWriter:
raise errors.ConfigurationError("Incomplete configuration"
" (missing cluster.rsahostkeypub)")
self._config_data = data
# init the last serial as -1 so that the next write will cause
# ssconf update
self._last_cluster_serial = -1
def _DistributeConfig(self):
"""Distribute the configuration to the other nodes.
......@@ -860,7 +863,9 @@ class ConfigWriter:
self._DistributeConfig()
# Write ssconf files on all nodes (including locally)
rpc.RpcRunner.call_write_ssconf_files(self._UnlockedGetNodeList())
if self._last_cluster_serial < self._config_data.cluster.serial_no:
rpc.RpcRunner.call_write_ssconf_files(self._UnlockedGetNodeList())
self._last_cluster_serial = self._config_data.cluster.serial_no
@locking.ssynchronized(_config_lock)
def InitConfig(self, version, cluster_config, master_node_config):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment