a3470f
From ee764746030bb04a702504e3e4c0f8115928aef5 Mon Sep 17 00:00:00 2001
a3470f
From: Kotresh HR <khiremat@redhat.com>
a3470f
Date: Thu, 7 Dec 2017 04:46:08 -0500
a3470f
Subject: [PATCH 322/325] geo-rep: Cleanup stale unprocessed xsync changelogs
a3470f
a3470f
When geo-replication is in hybrid crawl, it crawls
a3470f
the file system and generates xsync changelogs.
a3470f
These changelogs are later processed to sync the
a3470f
data. If the worker goes to Faulty before processing
a3470f
all the generated xsync changelogs, those changelogs
a3470f
remain and is not cleaned up. When the worker
a3470f
comes back, it will re-crawl and re-generate xsync
a3470f
changelogs. So this patch cleans up the stale
a3470f
unprocessed xsync changelogs.
a3470f
a3470f
Backport of:
a3470f
 > Patch: https://review.gluster.org/18983
a3470f
 > Issue: #376
a3470f
a3470f
BUG: 1599037
a3470f
Change-Id: Ib92920c716c7d27e1eeb4bc4ebaf3efb48e0694d
a3470f
Signed-off-by: Kotresh HR <khiremat@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/144102
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
---
a3470f
 geo-replication/syncdaemon/master.py | 4 ++++
a3470f
 1 file changed, 4 insertions(+)
a3470f
a3470f
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
a3470f
index e484692..64e9836 100644
a3470f
--- a/geo-replication/syncdaemon/master.py
a3470f
+++ b/geo-replication/syncdaemon/master.py
a3470f
@@ -1527,6 +1527,10 @@ class GMasterXsyncMixin(GMasterChangelogMixin):
a3470f
                 pass
a3470f
             else:
a3470f
                 raise
a3470f
+        # Purge stale unprocessed xsync changelogs
a3470f
+        for f in os.listdir(self.tempdir):
a3470f
+            if f.startswith("XSYNC-CHANGELOG"):
a3470f
+                os.remove(os.path.join(self.tempdir, f))
a3470f
 
a3470f
     def crawl(self):
a3470f
         """
a3470f
-- 
a3470f
1.8.3.1
a3470f