gsyncd / geo-rep: ignore DHTs sticky bit file during crawl

Change-Id: Ide927759c6a3d5301475eac9f6e785aa901d426e
BUG: 1036539
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/6792
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
Venky Shankar 2013-12-12 17:03:09 +05:30 committed by Vijay Bellur
parent cbf6a264bd
commit aa7b0c6408
2 changed files with 25 additions and 0 deletions

View File

@ -1184,6 +1184,13 @@ class GMasterXsyncMixin(GMasterChangelogMixin):
if stime and stime[-1]: if stime and stime[-1]:
self.sync_stime(stime[-1], last) self.sync_stime(stime[-1], last)
def is_sticky(self, path, mo):
"""check for DHTs linkto sticky bit file"""
sticky = False
if mo & 01000:
sticky = self.master.server.linkto_check(path)
return sticky
def Xcrawl(self, path='.', xtr_root=None): def Xcrawl(self, path='.', xtr_root=None):
""" """
generate a CHANGELOG file consumable by process_change. generate a CHANGELOG file consumable by process_change.
@ -1235,6 +1242,9 @@ class GMasterXsyncMixin(GMasterChangelogMixin):
if isinstance(st, int): if isinstance(st, int):
logging.warn('%s got purged in the interim ...' % e) logging.warn('%s got purged in the interim ...' % e)
continue continue
if self.is_sticky(e, st.st_mode):
logging.debug('ignoring sticky bit file %s' % e)
continue
gfid = self.master.server.gfid(e) gfid = self.master.server.gfid(e)
if isinstance(gfid, int): if isinstance(gfid, int):
logging.warn('skipping entry %s..' % e) logging.warn('skipping entry %s..' % e)

View File

@ -321,6 +321,18 @@ class Server(object):
else: else:
raise raise
@classmethod
@_pathguard
def linkto_check(cls, path):
try:
return not (Xattr.lgetxattr_buf(path, 'trusted.glusterfs.dht.linkto') == '')
except (IOError, OSError):
ex = sys.exc_info()[1]
if ex.errno in (ENOENT, ENODATA):
return False
else:
raise
@classmethod @classmethod
@_pathguard @_pathguard
@ -1139,6 +1151,9 @@ class GLUSTER(AbstractUrl, SlaveLocal, SlaveRemote):
def gfid(cls, e): def gfid(cls, e):
""" path based backend gfid fetch """ """ path based backend gfid fetch """
return super(brickserver, cls).gfid(e) return super(brickserver, cls).gfid(e)
@classmethod
def linkto_check(cls, e):
return super(brickserver, cls).linkto_check(e)
if gconf.slave_id: if gconf.slave_id:
# define {,set_}xtime in slave, thus preempting # define {,set_}xtime in slave, thus preempting
# the call to remote, so that it takes data from # the call to remote, so that it takes data from