summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pihlak2012-10-24 11:03:50 +0000
committerMartin Pihlak2012-10-24 11:03:50 +0000
commit3f53b84684a1a434a37425d7db10af2b1b737955 (patch)
treea19fe8fc01be184f26219b348f698eedc5802d44
parent784496248a7eaecea2e9cc6dad1d62dd30dccb15 (diff)
Move set_last_complete AFTER rsync.
Previously .walshipping.last was updated before the rsync succeeded, it turns out that this was too optimistic -- occasionally the rsync fails and the .last file contains wrong information. This results in skipped files during "master sync".
-rwxr-xr-xpython/walmgr.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/walmgr.py b/python/walmgr.py
index 604ba691..830e0e1a 100755
--- a/python/walmgr.py
+++ b/python/walmgr.py
@@ -1502,7 +1502,6 @@ STOP TIME: %(stop_time)s
self.log.debug("%s: start copy", srcname)
self.master_periodic()
- self.set_last_complete(srcname)
dst_loc = self.cf.getfile("completed_wals")
if dst_loc[-1] != "/":
@@ -1517,6 +1516,9 @@ STOP TIME: %(stop_time)s
cmdline = ["ssh", "-nT", slave, "sync" ]
self.exec_cmd(cmdline)
+ # slave has the file now, set markers
+ self.set_last_complete(srcname)
+
self.log.debug("%s: done", srcname)
end_time = time.time()
self.stat_add('count', 1)