diff options
| author | Tamar Shacked <tshacked@redhat.com> | 2020-12-08 12:51:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-08 16:21:35 +0530 |
| commit | ae8cfe5baaff5b3e4c55f49ec71811e32a885271 (patch) | |
| tree | 7df28798034bb415868d39e75326f5f29b4dbee4 /cli/src | |
| parent | 3da6ae5edc4b8cd7a922769bb973365f1b4399a5 (diff) | |
glusterd/cli: enhance rebalance-status after replace/reset-brick (#1869)
* glusterd/cli: enhance rebalance-status after replace/reset-brick
Rebalance status is being reset during replace/reset-brick operations.
This cause 'volume status' to shows rebalance as "not started".
Fix:
change rebalance-status to "reset due to (replace|reset)-brick"
Change-Id: I6e3372d67355eb76c5965984a23f073289d4ff23
Signed-off-by: Tamar Shacked <tshacked@redhat.com>
* glusterd/cli: enhance rebalance-status after replace/reset-brick
Rebalance status is being reset during replace/reset-brick operations.
This cause 'volume status' to shows rebalance as "not started".
Fix: change rebalance-status to "reset due to (replace|reset)-brick"
Fixes: #1717
Signed-off-by: Tamar Shacked <tshacked@redhat.com>
Change-Id: I1e3e373ca3b2007b5b7005b6c757fb43801fde33
* cli: changing rebal task ID to "None" in case status is being reset
Rebalance status is being reset during replace/reset-brick operations.
This cause 'volume status' to shows rebalance as "not started".
Fix:
change rebalance-status to "reset due to (replace|reset)-brick"
Fixes: #1717
Change-Id: Ia73a8bea3dcd8e51acf4faa6434c3cb0d09856d0
Signed-off-by: Tamar Shacked <tshacked@redhat.com>
Diffstat (limited to 'cli/src')
| -rw-r--r-- | cli/src/cli-rpc-ops.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 4d068dbe4c..576f2a2fb2 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -67,6 +67,8 @@ char *cli_vol_task_status_str[] = {"not started", "fix-layout stopped", "fix-layout completed", "fix-layout failed", + "reset due to replace-brick", + "reset due to reset-brick", "unknown"}; static int32_t @@ -7114,12 +7116,21 @@ cli_print_volume_status_tasks(dict_t *dict) ret = dict_get_str(dict, key, &task_id_str); if (ret) return; - cli_out("%-20s : %-20s", "ID", task_id_str); snprintf(key, sizeof(key), "task%d.status", i); ret = dict_get_int32(dict, key, &status); - if (ret) + if (ret) { + cli_out("%-20s : %-20s", "ID", task_id_str); return; + } + + if (!strcmp(op, "Rebalance") && + (status == GF_DEFRAG_STATUS_RESET_DUE_REPLACE_BRC || + status == GF_DEFRAG_STATUS_RESET_DUE_RESET_BRC)) { + task_id_str = "None"; + } + + cli_out("%-20s : %-20s", "ID", task_id_str); snprintf(task, sizeof(task), "task%d", i); |
