From 76ed61bb5e3fefb3e4071a24f6dd26f37c950c77 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 25 Mar 2016 18:48:30 +0530 Subject: 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 split-brain latest-mtime where 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 Reviewed-on: http://review.gluster.org/13838 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Anuradha Talur CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- cli/src/cli-cmd-volume.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cli/src/cli-cmd-volume.c') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index f5926588a9e..26936c2a323 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -2115,6 +2115,7 @@ cli_print_brick_status (cli_volume_status_t *status) } #define NEEDS_GLFS_HEAL(op) ((op == GF_SHD_OP_SBRAIN_HEAL_FROM_BIGGER_FILE) || \ + (op == GF_SHD_OP_SBRAIN_HEAL_FROM_LATEST_MTIME) ||\ (op == GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK) || \ (op == GF_SHD_OP_INDEX_SUMMARY) || \ (op == GF_SHD_OP_SPLIT_BRAIN_FILES)) @@ -2143,6 +2144,10 @@ cli_launch_glfs_heal (int heal_op, dict_t *options) ret = dict_get_str (options, "file", &filename); runner_add_args (&runner, "bigger-file", filename, NULL); break; + case GF_SHD_OP_SBRAIN_HEAL_FROM_LATEST_MTIME: + ret = dict_get_str (options, "file", &filename); + runner_add_args (&runner, "latest-mtime", filename, NULL); + break; case GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK: ret = dict_get_str (options, "heal-source-hostname", &hostname); @@ -2627,7 +2632,7 @@ struct cli_cmd volume_cmds[] = { { "volume heal [enable | disable | full |" "statistics [heal-count [replica ]] |" "info [healed | heal-failed | split-brain] |" - "split-brain {bigger-file |" + "split-brain {bigger-file | latest-mtime |" "source-brick []}]", cli_cmd_volume_heal_cbk, "self-heal commands on volume specified by "}, -- cgit