21ab4e
From 66eb5c3e4c088d6b82357648a55cfb50685b9af9 Mon Sep 17 00:00:00 2001
21ab4e
From: Aravinda VK <avishwan@redhat.com>
21ab4e
Date: Tue, 6 Sep 2016 12:02:02 +0530
21ab4e
Subject: [PATCH 354/361] geo-rep: Fix ESTALE/EINVAL issue during
21ab4e
 set_{xtime,stime}
21ab4e
21ab4e
Setfattr may get ESTALE/EINVAL if a file is being unlinked.
21ab4e
To prevent worker crashing, added retry for these error messages.
21ab4e
21ab4e
On second retry it will get ENOENT and that error is handled by
21ab4e
ignoring.
21ab4e
21ab4e
mainline:
21ab4e
> BUG: 1373373
21ab4e
> Reviewed-on: http://review.gluster.org/15404
21ab4e
> Smoke: Gluster Build System <jenkins@build.gluster.org>
21ab4e
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
21ab4e
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
21ab4e
> Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
21ab4e
> Reviewed-by: Kotresh HR <khiremat@redhat.com>
21ab4e
(cherry picked from commit 5b87a7cd69ef7c93f605ca35d14ddb94c446e699)
21ab4e
21ab4e
BUG: 1425684
21ab4e
Change-Id: Ic660fa13208366d57c8d3d492bbef611475e45b7
21ab4e
Signed-off-by: Aravinda VK <avishwan@redhat.com>
21ab4e
Reviewed-on: https://code.engineering.redhat.com/gerrit/101413
21ab4e
Tested-by: Milind Changire <mchangir@redhat.com>
21ab4e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
21ab4e
---
21ab4e
 geo-replication/syncdaemon/resource.py | 17 +++++++++++++++--
21ab4e
 1 file changed, 15 insertions(+), 2 deletions(-)
21ab4e
21ab4e
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
21ab4e
index 9ac5c2d..3ba5cf2 100644
21ab4e
--- a/geo-replication/syncdaemon/resource.py
21ab4e
+++ b/geo-replication/syncdaemon/resource.py
21ab4e
@@ -546,7 +546,19 @@ class Server(object):
21ab4e
                    [path,
21ab4e
                     '.'.join([cls.GX_NSPACE, uuid, 'stime']),
21ab4e
                     struct.pack('!II', *mark)],
21ab4e
-                   [ENOENT])
21ab4e
+                   [ENOENT],
21ab4e
+                   [ESTALE, EINVAL])
21ab4e
+
21ab4e
+    @classmethod
21ab4e
+    @_pathguard
21ab4e
+    def set_entry_stime(cls, path, uuid, mark):
21ab4e
+        """set @mark as stime for @uuid on @path"""
21ab4e
+        errno_wrap(Xattr.lsetxattr,
21ab4e
+                   [path,
21ab4e
+                    '.'.join([cls.GX_NSPACE, uuid, 'entry_stime']),
21ab4e
+                    struct.pack('!II', *mark)],
21ab4e
+                   [ENOENT],
21ab4e
+                   [ESTALE, EINVAL])
21ab4e
 
21ab4e
     @classmethod
21ab4e
     @_pathguard
21ab4e
@@ -556,7 +568,8 @@ class Server(object):
21ab4e
                    [path,
21ab4e
                     '.'.join([cls.GX_NSPACE, uuid, 'xtime']),
21ab4e
                     struct.pack('!II', *mark)],
21ab4e
-                   [ENOENT])
21ab4e
+                   [ENOENT],
21ab4e
+                   [ESTALE, EINVAL])
21ab4e
 
21ab4e
     @classmethod
21ab4e
     @_pathguard
21ab4e
-- 
21ab4e
1.8.3.1
21ab4e