summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-07-04 08:46:06 -0400
committerRaghavendra Talur <rtalur@redhat.com>2017-07-07 07:47:54 +0000
commitee1cbbee1cacfe69ef6d86f2f1340a9171de3874 (patch)
tree4e76ff3535b322f6170f726e474ee9fda3a44a0c
parent0f725500f50f386a19e33b077c7590d75bb276d8 (diff)
geo-rep: Fix entry failure because parent dir doesn't exist
In a distributed volume on master, it can so happen that the RMDIR followed by MKDIR is recorded in changelog on a particular subvolume with same gfid and pargfid/bname but not on all subvolumes as below. E 61c67a2e-07f2-45a9-95cf-d8f16a5e9c36 RMDIR \ 9cc51be8-91c3-4ef4-8ae3-17596fcfed40%2Ffedora2 E 61c67a2e-07f2-45a9-95cf-d8f16a5e9c36 MKDIR 16877 0 0 \ 9cc51be8-91c3-4ef4-8ae3-17596fcfed40%2Ffedora2 While processing this changelog, geo-rep thinks RMDIR is successful and does recursive rmdir on slave. But in the master the directory still exists. This could lead to data discrepancy between master and slave. Cause: RMDIR-MKDIR pair gets recorded so in changelog when the directory removal is successful on cached subvolume and failed in one of hashed subvol for some reason (may be down). In this case, the directory is re-created on cached subvol which gets recorded as MKDIR again in changelog. Solution: So while processing RMDIR geo-replication should stat on master with gfid and should not delete it if it's present. > Change-Id: If5da1d6462eb4d9ebe2e88b3a70cc454411a133e > BUG: 1467718 > Signed-off-by: Kotresh HR <khiremat@redhat.com> > Reviewed-on: https://review.gluster.org/17695 > Smoke: Gluster Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Aravinda VK <avishwan@redhat.com> (cherry picked from commit b25bf64f3a3520a96ad557daa4903c0ceba96d72) Change-Id: If5da1d6462eb4d9ebe2e88b3a70cc454411a133e BUG: 1468198 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: https://review.gluster.org/17714 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
-rw-r--r--geo-replication/syncdaemon/master.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index b096bc77ebe..9724952fa70 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -849,6 +849,11 @@ class GMasterChangelogMixin(GMasterCommon):
# file got unlinked, May be historical Changelog
datas.remove(pt)
+ if ty in ['RMDIR'] and not isinstance(st, int):
+ logging.info(lf('Ignoring rmdir. Directory present in '
+ 'master', gfid=gfid, pgfid_bname=en))
+ continue
+
if not boolify(gconf.ignore_deletes):
if not ignore_entry_ops:
entries.append(edct(ty, gfid=gfid, entry=en))