From dc8d65381bbead0a00d045b7040e0cd86d80955b Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Mon, 21 Sep 2015 14:51:13 +0530 Subject: geo-rep: Fix syncing chown in xsync crawl GEO-REP INTEROP WITH SHARD FEATURE Problem: The sequence of entry creation and chown in master is recorded as creation of entry with resulted user:group in xsync changelog. During sync, entry creation is always split into two ops, MKNOD and SETATTR. Hence the issue is not being hit otherwise it would have failed with EPERM if parent is owned by different user. But with shard translator being enabled on slave, doing entry creation with MKNOD and SETATTR is not allowed, SETATTR fails as it accesses inode structure which is not linked. Solution: The sequence of entry creation and chown in master should be recorded as MKNOD and SETATTR separately always and do entry creation with single op in gfid-access xlator. The gfid-access patch will be sent separately. Change-Id: I93e554bf9342397a7660503f5128e9709f8a0cd8 BUG: 1265148 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/12205 Tested-by: NetBSD Build System Reviewed-by: Aravinda VK --- geo-replication/syncdaemon/master.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'geo-replication/syncdaemon/master.py') diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index 0555b95b36b..c49062da3d4 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -1401,9 +1401,8 @@ class GMasterXsyncMixin(GMasterChangelogMixin): self.sync_done(self.stimes, False) self.stimes = [] if stat.S_ISDIR(mo): - self.write_entry_change("E", [gfid, 'MKDIR', str(mo), str( - st.st_uid), str(st.st_gid), escape(os.path.join(pargfid, - bname))]) + self.write_entry_change("E", [gfid, 'MKDIR', str(mo), + str(0), str(0), escape(os.path.join(pargfid, bname))]) self.write_entry_change("M", [gfid, "SETATTR", str(st.st_uid), str(st.st_gid), str(st.st_mode), str(st.st_atime), @@ -1433,8 +1432,7 @@ class GMasterXsyncMixin(GMasterChangelogMixin): if nlink == 1: self.write_entry_change("E", [gfid, 'MKNOD', str(mo), - str(st.st_uid), - str(st.st_gid), + str(0), str(0), escape(os.path.join( pargfid, bname))]) else: -- cgit