summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-parser.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2016-03-25 18:48:30 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-04-04 10:33:56 -0700
commit76ed61bb5e3fefb3e4071a24f6dd26f37c950c77 (patch)
tree3a6b4daf719788794238b0e2754822fe76635f75 /cli/src/cli-cmd-parser.c
parent028afb21a7793d3efbb9db431bde37ec332d9839 (diff)
afr: add mtime based split-brain resolution to CLI
Backport of http://review.gluster.org/#/c/13828/ Extended the CLI to include support for split-brain resolution based on mtime. The command syntax is: $:gluster volume heal <VOLNAME> split-brain latest-mtime <FILE> where <FILE> can be either the full file name as seen from the root of the volume (or) the gfid-string representation of the file. Change-Id: I7a16f72ff1a4495aa69f43f22758a9404e958b4f BUG: 1321748 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/13838 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Anuradha Talur <atalur@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r--cli/src/cli-cmd-parser.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 8fb78230935..206acddaa83 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -3604,6 +3604,16 @@ cli_cmd_volume_heal_options_parse (const char **words, int wordcount,
goto out;
goto done;
}
+ if (!strcmp (words[4], "latest-mtime")) {
+ ret = dict_set_int32 (dict, "heal-op",
+ GF_SHD_OP_SBRAIN_HEAL_FROM_LATEST_MTIME);
+ if (ret)
+ goto out;
+ ret = dict_set_str (dict, "file", (char *)words[5]);
+ if (ret)
+ goto out;
+ goto done;
+ }
if (!strcmp (words[4], "source-brick")) {
ret = dict_set_int32 (dict, "heal-op",
GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK);