diff options
author | Kotresh H R <khiremat@redhat.com> | 2014-08-01 16:12:38 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-08 12:02:19 -0700 |
commit | 81a127513da40424c572d566c1f26a7dfb345037 (patch) | |
tree | a0cf87e5d13742015353843db64ec934ed75e688 /xlators/features | |
parent | 85275c5f1d9fe120ed45147a15be74b70d4c7958 (diff) |
feature/geo-rep: Keep marker.tstamp's mtime unchangeable during snapshot.
Problem:
Geo-replicatoin does a full xsync crawl after snapshot
restoration of slave and master. It does not do history crawl.
Analysis:
Marker creates 'marker.tstamp' file when geo-rep is started
for the first time. The virtual extended attribute
'trusted.glusterfs.volume-mark' is maintained and whenever
it is queried on gluster mount point, marker fills it on
the fly and returns the combination of uuid, ctime of
marker.tstamp and others. So ctime of marker.tstamp, in other
sense 'volume-mark' marks the geo-rep start time when the
session is freshly created.
From the above, after the first filesystem crawl(xsync) is
done during first geo-rep start, stime should always be less
than 'volume-mark'. So whenever stime is less than volume-mark,
it does full filesystem crawl (xsync).
Root Cause:
When snapshot is restored, marker.tstamp file is freshly
created losing the timestamps, it was originally created with.
Solution:
1. Change is made to depend on mtime instead of ctime.
2. mtime and atime of marker.tstamp is restored back when
snapshot is created and restored.
BUG: 1138952
Change-Id: I0e19e1cb2593171b9a2b41d0d303330feb7fd2b3
Signed-off-by: Kotresh H R <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/8401
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/8642
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/marker/src/marker.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index fb86469857f..5f67e1dcf8f 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -216,8 +216,8 @@ stat_stampfile (xlator_t *this, marker_conf_t *priv, if (stat (priv->timestamp_file, &buf) != -1) { vol_mark->retval = 0; - vol_mark->sec = htonl (buf.st_ctime); - vol_mark->usec = htonl (ST_CTIM_NSEC (&buf)/1000); + vol_mark->sec = htonl (buf.st_mtime); + vol_mark->usec = htonl (ST_MTIM_NSEC (&buf)/1000); } else vol_mark->retval = 1; |