From 70fd68d94f768c098b3178c151fa92c5079a8cfd Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Fri, 22 Apr 2016 16:56:47 +0530 Subject: georep: add reset-sync-time option for session delete Set the stime xattr at all the brick roots to (0,0) if the argument reset-sync-time has been provided on the command-line. To avoid testing against directory specific stime, the remote stime is assumed to be minus_infinity, if the root directory stime is set to (0,0), before the directory scan begins. This triggers a full volume resync to slave in the case of a geo-rep session recreation with the same master-slave volume pair. Command synopsis: gluster volume geo-replication :: delete \ [reset-sync-time] Update gluster cli man page to include new sub-command reset-sync-time. Change-Id: Ie4ce03b9425ed9bb81eda8681058c0fc6f990948 BUG: 1311926 Signed-off-by: Milind Changire Reviewed-on: http://review.gluster.org/14051 Reviewed-by: Kotresh HR Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Aravinda VK --- cli/src/cli-cmd-parser.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index ae74d441c33..a570c343133 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -2574,7 +2574,7 @@ cli_cmd_gsync_set_parse (const char **words, int wordcount, dict_t **options) * volume geo-replication [$m [$s]] status [detail] * volume geo-replication [$m] $s config [[!]$opt [$val]] * volume geo-replication $m $s start|stop [force] - * volume geo-replication $m $s delete + * volume geo-replication $m $s delete [reset-sync-time] * volume geo-replication $m $s pause [force] * volume geo-replication $m $s resume [force] */ @@ -2702,6 +2702,22 @@ cli_cmd_gsync_set_parse (const char **words, int wordcount, dict_t **options) cmdi++; } + if (type == GF_GSYNC_OPTION_TYPE_DELETE && + !strcmp ((char *)words[wordcount-1], "reset-sync-time")) { + if (strcmp ((char *)words[wordcount-2], "delete")) { + ret = -1; + goto out; + } + if (!slavei || !masteri) { + ret = -1; + goto out; + } + ret = dict_set_uint32 (dict, "reset-sync-time", _gf_true); + if (ret) + goto out; + cmdi++; + } + if (type != GF_GSYNC_OPTION_TYPE_CONFIG && (cmdi < wordcount - 1 || glob)) goto out; -- cgit