summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2016-05-25 11:56:56 +0530
committerAravinda VK <avishwan@redhat.com>2016-06-13 04:27:11 -0700
commit1a348bfaeb9f2a50ec8ce27e5477e9b430c58b3c (patch)
treea5e54c979f3166f911b54ea0e80b470ceec56f9f /geo-replication
parentccb906c8a8139b66130192080020709bfc6d0dc3 (diff)
geo-rep: Handle stime/xtime set failures
While setting stime/xtime, if the file or directory is already deleted then Geo-rep will crash with ENOENT. With this patch, Geo-rep will ignores ENOENT since stime/xtime can't be applied on a deleted file/directory. Change-Id: I2d90569e51565f81ae53fcb23323e4f47c9e9672 Signed-off-by: Aravinda VK <avishwan@redhat.com> BUG: 1339471 Reviewed-on: http://review.gluster.org/14529 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com> Reviewed-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication')
-rw-r--r--geo-replication/syncdaemon/resource.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 27f7e84a2ce..bc7b13c95bc 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -534,17 +534,21 @@ class Server(object):
@_pathguard
def set_stime(cls, path, uuid, mark):
"""set @mark as stime for @uuid on @path"""
- Xattr.lsetxattr(
- path, '.'.join([cls.GX_NSPACE, uuid, 'stime']),
- struct.pack('!II', *mark))
+ errno_wrap(Xattr.lsetxattr,
+ [path,
+ '.'.join([cls.GX_NSPACE, uuid, 'stime']),
+ struct.pack('!II', *mark)],
+ [ENOENT])
@classmethod
@_pathguard
def set_xtime(cls, path, uuid, mark):
"""set @mark as xtime for @uuid on @path"""
- Xattr.lsetxattr(
- path, '.'.join([cls.GX_NSPACE, uuid, 'xtime']),
- struct.pack('!II', *mark))
+ errno_wrap(Xattr.lsetxattr,
+ [path,
+ '.'.join([cls.GX_NSPACE, uuid, 'xtime']),
+ struct.pack('!II', *mark)],
+ [ENOENT])
@classmethod
@_pathguard