summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2013-09-16 14:04:05 +0530
committerAnand Avati <avati@redhat.com>2013-09-20 11:46:31 -0700
commitd702e702e7248da63449b714507010bb3ef1072d (patch)
tree5b8bac34bb3e885e910eac8a73e359df389dd12e
parente2093fb1500f55f58236d37a996609a2a1e1af8e (diff)
geo-rep: create hardlink as hardlinks in xsync crawl
BUG: 847839 Change-Id: Ieaa754f15611392c09afcc7190b9ff9da39d7fce Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: http://review.gluster.org/5934 Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--geo-replication/syncdaemon/master.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index f18a60e6f49..753d0a614fe 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -884,13 +884,18 @@ class GMasterXsyncMixin(GMasterChangelogMixin):
if stat.S_ISDIR(mo):
self.write_entry_change("E", [gfid, 'MKDIR', escape(os.path.join(pargfid, bname))])
self.crawl(e, xtr)
- elif stat.S_ISREG(mo):
- self.write_entry_change("E", [gfid, 'CREATE', escape(os.path.join(pargfid, bname))])
- self.write_entry_change("D", [gfid])
elif stat.S_ISLNK(mo):
self.write_entry_change("E", [gfid, 'SYMLINK', escape(os.path.join(pargfid, bname))])
else:
- logging.info('ignoring %s' % e)
+ # if a file has a hardlink, create a Changelog entry as 'LINK' so the slave
+ # side will decide if to create the new entry, or to create link.
+ if st.st_nlink == 1:
+ self.write_entry_change("E", [gfid, 'MKNOD', escape(os.path.join(pargfid, bname))])
+ else:
+ self.write_entry_change("E", [gfid, 'LINK', escape(os.path.join(pargfid, bname))])
+ if stat.S_ISREG(mo):
+ self.write_entry_change("D", [gfid])
+
if path == '.':
logging.info('processing xsync changelog %s' % self.fname())
self.close()