diff options
author | Martin Pihlak | 2012-10-24 11:03:50 +0000 |
---|---|---|
committer | Martin Pihlak | 2012-10-24 11:03:50 +0000 |
commit | 3f53b84684a1a434a37425d7db10af2b1b737955 (patch) | |
tree | a19fe8fc01be184f26219b348f698eedc5802d44 | |
parent | 784496248a7eaecea2e9cc6dad1d62dd30dccb15 (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-x | python/walmgr.py | 4 |
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) |