diff options
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/src/cli-cmd-parser.c | 10 | ||||
| -rw-r--r-- | cli/src/cli-cmd-volume.c | 7 | ||||
| -rw-r--r-- | cli/src/cli-rpc-ops.c | 3 | 
3 files changed, 18 insertions, 2 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); 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 <VOLNAME> [enable | disable | full |"            "statistics [heal-count [replica <HOSTNAME:BRICKNAME>]] |"            "info [healed | heal-failed | split-brain] |" -          "split-brain {bigger-file <FILE> |" +          "split-brain {bigger-file <FILE> | latest-mtime <FILE> |"                         "source-brick <HOSTNAME:BRICKNAME> [<FILE>]}]",            cli_cmd_volume_heal_cbk,            "self-heal commands on volume specified by <VOLNAME>"}, diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 275eb545980..9b2699a6471 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -8469,9 +8469,10 @@ gf_cli_heal_volume_cbk (struct rpc_req *req, struct iovec *iov,          case    GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:                  heal_op_str = "count of entries to be healed per replica";                  break; -        /* The below 2 cases are never hit; they're coded only to make +        /* The below 3 cases are never hit; they're coded only to make           * compiler warnings go away.*/          case    GF_SHD_OP_SBRAIN_HEAL_FROM_BIGGER_FILE: +        case    GF_SHD_OP_SBRAIN_HEAL_FROM_LATEST_MTIME:          case    GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK:                  break;  | 
