summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--geo-replication/syncdaemon/master.py14
-rw-r--r--geo-replication/syncdaemon/resource.py4
2 files changed, 15 insertions, 3 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 51c1e571e53..48da768c935 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -742,10 +742,12 @@ class GMasterCommon(object):
class XCrawlMetadata(object):
- def __init__(self, st_uid, st_gid, st_mode):
+ def __init__(self, st_uid, st_gid, st_mode, st_atime, st_mtime):
self.st_uid = int(st_uid)
self.st_gid = int(st_gid)
self.st_mode = int(st_mode)
+ self.st_atime = float(st_atime)
+ self.st_mtime = float(st_mtime)
class GMasterChangelogMixin(GMasterCommon):
@@ -816,6 +818,8 @@ class GMasterChangelogMixin(GMasterCommon):
dst['uid'] = st.st_uid
dst['gid'] = st.st_gid
dst['mode'] = st.st_mode
+ dst['atime'] = st.st_atime
+ dst['mtime'] = st.st_mtime
else:
dct[k] = ed[k]
return dct
@@ -907,7 +911,9 @@ class GMasterChangelogMixin(GMasterCommon):
meta_gfid.add((os.path.join(pfx, ec[0]),
XCrawlMetadata(st_uid=ec[2],
st_gid=ec[3],
- st_mode=ec[4])))
+ st_mode=ec[4],
+ st_atime=ec[5],
+ st_mtime=ec[6])))
else:
meta_gfid.add((os.path.join(pfx, ec[0]), ))
else:
@@ -1482,7 +1488,9 @@ class GMasterXsyncMixin(GMasterChangelogMixin):
st.st_uid), str(st.st_gid), escape(os.path.join(pargfid,
bname))])
self.write_entry_change("M", [gfid, "SETATTR", str(st.st_uid),
- str(st.st_gid), str(st.st_mode)])
+ str(st.st_gid), str(st.st_mode),
+ str(st.st_atime),
+ str(st.st_mtime)])
self.Xcrawl(e, xtr_root)
stime_to_update = xte
if self.xsync_upper_limit:
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 1e11b980ad3..c20a243352b 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -669,9 +669,13 @@ class Server(object):
mode = e['stat']['mode']
uid = e['stat']['uid']
gid = e['stat']['gid']
+ atime = e['stat']['atime']
+ mtime = e['stat']['mtime']
go = e['go']
errno_wrap(os.chmod, [go, mode], [ENOENT], [ESTALE, EINVAL])
errno_wrap(os.chown, [go, uid, gid], [ENOENT], [ESTALE, EINVAL])
+ errno_wrap(os.utime, [go, (atime, mtime)],
+ [ENOENT], [ESTALE, EINVAL])
@classmethod
@_pathguard