Skip to content
Snippets Groups Projects
Commit 9d38c6e1 authored by Iustin Pop's avatar Iustin Pop
Browse files

Switch the global serial_no to the top object

Currently the serial_no that is incremented every time the configuration
file is written is located on the 'cluster' object in the configuration
structure. However, this is wrong as the cluster serial_no should be
incremented only when the cluster state is changed (for whatever
definition of “changed” we will use), not simply because the
configuration file is written.

This patch changes so that the ConfigWriter._BumpSerialNo affects the
top-level ConfigData object.

Reviewed-by: ultrotter
parent be1fa613
No related branches found
No related tags found
No related merge requests found
......@@ -677,7 +677,7 @@ class ConfigWriter:
"""Bump up the serial number of the config.
"""
self._config_data.cluster.serial_no += 1
self._config_data.serial_no += 1
def _OpenConfig(self):
"""Read the config data from disk.
......@@ -805,7 +805,8 @@ class ConfigWriter:
self._config_data = objects.ConfigData(nodes={node: nodeconfig},
instances={},
cluster=globalconfig)
cluster=globalconfig,
serial_no=1)
self._WriteConfig()
@locking.ssynchronized(_config_lock, shared=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment