From 8910136c09e11f651fe846e3f357341b9260930e Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Wed, 21 Aug 2013 16:33:41 +0530 Subject: gsyncd / geo-rep: overload rename with an unlink This is certainly a "hack" for cases when after a rename the gfid is unlinked (which is now pointed by a different pargfid/basename). This was osbserved when a file edited (uisng vi/vim) on the glusterfs mount point which has a geo-replication session running. Change-Id: I0a5d9f0f549aa4403671fa1f11e95510142e5720 BUG: 1003800 Signed-off-by: Avra Sengupta Signed-off-by: Venky Shankar Reviewed-by: Amar Tumballi Tested-by: Amar Tumballi Reviewed-on: http://review.gluster.org/5755 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- geo-replication/syncdaemon/master.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'geo-replication') diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index 1ef76061..ef151a32 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -685,7 +685,10 @@ class GMasterChangelogMixin(GMasterCommon): go = os.path.join(pfx, gfid) st = lstat(go) if isinstance(st, int): - logging.debug('file %s got purged in the interim' % go) + if ty == 'RENAME': + entries.append(edct('UNLINK', gfid=gfid, entry=en)) + else: + logging.debug('file %s got purged in the interim' % go) continue entry_update(go, st.st_size, st.st_mode) if ty in ['CREATE', 'MKDIR', 'MKNOD']: -- cgit