geo-rep: Changes required as part of changelog version 1.2

The index value for UNLINK and RMDIR in changelog
is no more the last index. It varies based on whether
the 'changelog.capture-del-path' is enabled or not.
Hence, fixed index is used.

The option to capture deleted path in changelog comes
with the patch: http://review.gluster.org/#/c/10288/
And the parser changes with http://review.gluster.org/#/c/10166/

Change-Id: Idc1a2e2bf90c888be4524d3ce74865aea09485de
BUG: 1214561
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/10344
Tested-by: NetBSD Build System
Reviewed-by: Aravinda VK <avishwan@redhat.com>
This commit is contained in:
Kotresh HR 2015-04-23 10:18:49 +05:30 committed by Vijay Bellur
parent 2e16e38312
commit 8c053f3fd1

View File

@ -800,6 +800,7 @@ class GMasterChangelogMixin(GMasterCommon):
# index for change type and entry
IDX_START = 0
IDX_END = 2
UNLINK_ENTRY = 2
POS_GFID = 0
POS_TYPE = 1
@ -934,6 +935,11 @@ class GMasterChangelogMixin(GMasterCommon):
gfid = ec[self.POS_GFID]
if ty in ['UNLINK', 'RMDIR']:
# The index of PARGFID/BNAME for UNLINK, RMDIR
# is no more the last index. It varies based on
# changelog.capture-del-path is enabled or not.
en = unescape(os.path.join(pfx, ec[self.UNLINK_ENTRY]))
# Remove from DATA list, so that rsync will
# not fail
pt = os.path.join(pfx, ec[0])