Blob Blame History Raw
From 7e06cf6040c00a6ef389e5764f17527ebee4d615 Mon Sep 17 00:00:00 2001
From: Kotresh HR <khiremat@redhat.com>
Date: Wed, 19 Jul 2017 04:41:34 -0400
Subject: [PATCH 567/569] geo-rep: Fix worker crash during RMDIR

With bug [1], we are checking for the directory presence
in master. If the directory is present, geo-rep won't
proceed with RMDIR. The stat was already being done as
part of [2] in upstream and the patch [3] for bug [1]
just used the existing stat information. But the patch [2]
is not taken into downstream but patch [3] is taken into
downstream causing this issue. The fix is to add the stat.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1468186'
[2]: http://review.gluster.org/15110
[3]: https://review.gluster.org/#/c/17695

Label: DOWNSTREAM ONLY

Change-Id: Id5d31a9e65b3d60b6946e24f45df74f5ad8c15b0
BUG: 1472604
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/112794
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 geo-replication/syncdaemon/master.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 3bd9b54..b486de4 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -820,7 +820,9 @@ class GMasterChangelogMixin(GMasterCommon):
                     # Remove from DATA list, so that rsync will
                     # not fail
                     pt = os.path.join(pfx, ec[0])
-                    if pt in datas:
+                    st = lstat(pt)
+                    if pt in datas and isinstance(st, int):
+                        # file got unlinked, May be historical Changelog
                         datas.remove(pt)
 
                     if ty in ['RMDIR'] and not isinstance(st, int):
-- 
1.8.3.1