summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-10-06 22:42:43 -0400
committerjiffin tony Thottan <jthottan@redhat.com>2017-10-12 18:38:06 +0000
commite59c078f5ad8b92966033f9c008193938ba6f3ca (patch)
tree6874f5110d1cc5a00126a93a059bd4878a8c58e9 /geo-replication
parent19cff934acb6893f12c1617e99c3131439374513 (diff)
geo-rep: Add ENODATA to retry list on gfid getxattr
During xsync crawl, worker occasionally crashed with ENODATA on getting gfid from backend. This is not persistent and is transient. Worker restart invovles re-processing of few entries in changenlogs. So adding ENODATA to retry list to avoid worker restart. > Change-Id: Ib78d1e925c0a83c78746f28f7c79792a327dfd3e > BUG: 1499391 > Signed-off-by: Kotresh HR <khiremat@redhat.com> (cherry picked from commit b56bdb34dafd1a87c5bbb2c9a75d1a088d82b1f4) Change-Id: Ib78d1e925c0a83c78746f28f7c79792a327dfd3e BUG: 1500841 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication')
-rw-r--r--geo-replication/syncdaemon/resource.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 45106af2c85..0ca023cd8c5 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -348,17 +348,14 @@ class Server(object):
@classmethod
@_pathguard
def gfid(cls, path):
- try:
- buf = Xattr.lgetxattr(path, cls.GFID_XATTR, 16)
+ buf = errno_wrap(Xattr.lgetxattr, [path, cls.GFID_XATTR, 16],
+ [ENOENT], [ESTALE, ENODATA])
+ if buf == ENOENT:
+ return buf
+ else:
m = re.match('(.{8})(.{4})(.{4})(.{4})(.{12})', "".join(
['%02x' % x for x in struct.unpack(cls.GFID_FMTSTR, buf)]))
return '-'.join(m.groups())
- except (IOError, OSError):
- ex = sys.exc_info()[1]
- if ex.errno == ENOENT:
- return ex.errno
- else:
- raise
@classmethod
@_pathguard