21ab4e
From 7e06cf6040c00a6ef389e5764f17527ebee4d615 Mon Sep 17 00:00:00 2001
21ab4e
From: Kotresh HR <khiremat@redhat.com>
21ab4e
Date: Wed, 19 Jul 2017 04:41:34 -0400
21ab4e
Subject: [PATCH 567/569] geo-rep: Fix worker crash during RMDIR
21ab4e
21ab4e
With bug [1], we are checking for the directory presence
21ab4e
in master. If the directory is present, geo-rep won't
21ab4e
proceed with RMDIR. The stat was already being done as
21ab4e
part of [2] in upstream and the patch [3] for bug [1]
21ab4e
just used the existing stat information. But the patch [2]
21ab4e
is not taken into downstream but patch [3] is taken into
21ab4e
downstream causing this issue. The fix is to add the stat.
21ab4e
21ab4e
[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1468186'
21ab4e
[2]: http://review.gluster.org/15110
21ab4e
[3]: https://review.gluster.org/#/c/17695
21ab4e
21ab4e
Label: DOWNSTREAM ONLY
21ab4e
21ab4e
Change-Id: Id5d31a9e65b3d60b6946e24f45df74f5ad8c15b0
21ab4e
BUG: 1472604
21ab4e
Signed-off-by: Kotresh HR <khiremat@redhat.com>
21ab4e
Reviewed-on: https://code.engineering.redhat.com/gerrit/112794
21ab4e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
---
21ab4e
 geo-replication/syncdaemon/master.py | 4 +++-
21ab4e
 1 file changed, 3 insertions(+), 1 deletion(-)
21ab4e
21ab4e
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
21ab4e
index 3bd9b54..b486de4 100644
21ab4e
--- a/geo-replication/syncdaemon/master.py
21ab4e
+++ b/geo-replication/syncdaemon/master.py
21ab4e
@@ -820,7 +820,9 @@ class GMasterChangelogMixin(GMasterCommon):
21ab4e
                     # Remove from DATA list, so that rsync will
21ab4e
                     # not fail
21ab4e
                     pt = os.path.join(pfx, ec[0])
21ab4e
-                    if pt in datas:
21ab4e
+                    st = lstat(pt)
21ab4e
+                    if pt in datas and isinstance(st, int):
21ab4e
+                        # file got unlinked, May be historical Changelog
21ab4e
                         datas.remove(pt)
21ab4e
 
21ab4e
                     if ty in ['RMDIR'] and not isinstance(st, int):
21ab4e
-- 
21ab4e
1.8.3.1
21ab4e