summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/gsyncdstatus.py
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2018-05-07 01:23:46 -0400
committerAravinda VK <avishwan@redhat.com>2018-05-07 10:17:15 +0000
commit23c1385b5f6f6103e820d15ecfe1df31940fdb45 (patch)
tree1857d4747ba8a61c0adb8c142eff40ade3b9d6c0 /geo-replication/syncdaemon/gsyncdstatus.py
parent5e356e3f470779433bfe6b0b368676062842b367 (diff)
geo-rep: Fix upgrade issue
Cause and Analysis: The last synced changelog for entry operations is marked in current version to avoid re-processing of already processed entry operations in a batch during crash/restart of geo-rep. This was not present in previous versoins. The marker is maintained in the dictionary with the key 'last_synced_entry' and dictionary is persisted into status file. So upgrading to current version in which the marker is present was failing with KeyError. Solution: Load the dictionary with default keys first which contains all the keys including latest ones and then load the values from status file instead of doing otherwise. fixes: bz#1575490 Change-Id: Ic654e6f9a3c97f616761f1362f890352a2186fb4 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/gsyncdstatus.py')
-rw-r--r--geo-replication/syncdaemon/gsyncdstatus.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/gsyncdstatus.py b/geo-replication/syncdaemon/gsyncdstatus.py
index 02584b311d6..e75f9dcd62c 100644
--- a/geo-replication/syncdaemon/gsyncdstatus.py
+++ b/geo-replication/syncdaemon/gsyncdstatus.py
@@ -153,11 +153,12 @@ class GeorepStatus(object):
**kwargs)
def _update(self, mergerfunc):
+ data = self.default_values
with LockedOpen(self.filename, 'r+') as f:
try:
- data = json.load(f)
+ data.update(json.load(f))
except ValueError:
- data = self.default_values
+ pass
data = mergerfunc(data)
# If Data is not changed by merger func