diff options
author | Avra Sengupta <asengupt@redhat.com> | 2014-03-13 01:04:40 +0000 |
---|---|---|
committer | Rajesh Joseph <rjoseph@redhat.com> | 2014-04-02 06:03:25 -0700 |
commit | 0ce369a0aa511e98fd71c0337181a5577b2d8a1f (patch) | |
tree | 842fa4958e10a786572d22b81af2cd0813569da0 /cli/src | |
parent | ee4e8bb5339f5517d3d248f559becfd58013a0fe (diff) |
glusterd/snapshot: Making snap operations crash consistent
In the events of a volume's brick being down, or a node being
down, making snap ops like create, delete, restore, and
status crash consistent.
Marking snap status of snap bricks which were not snapshotted
because the volume brick was down as -1, and not starting those
snap bricks till the snapshot is taken.
During delete bypassing lvm snapshot remove for snap bricks
whose snap status is -1
During restore bypass replacing xattrs on the snapshot bricks
whose snap status is -1. Also bumping restored volume's version
so as to handle nodes being down. On handshake of a restored
volume, passing brick's snap_status as well.
During snapshot status of the non-snapshotted brick details
display "N/A". If a node is down, the entry itself will not
be displayed.
Change-Id: Id042efd7507829995270da0b2b2a6282a08a053d
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7241
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 6e0f24d5f..e3eae022a 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -8106,9 +8106,9 @@ cli_get_snap_volume_status (dict_t *dict, char *key_prefix) ret = dict_get_str (dict, key, &buffer); if (ret) { - gf_log ("cli", GF_LOG_ERROR, + gf_log ("cli", GF_LOG_INFO, "Unable to get Brick Path"); - goto out; + continue; } cli_out ("\n\t%-17s %s %s", "Brick Path", ":", buffer); @@ -8120,11 +8120,11 @@ cli_get_snap_volume_status (dict_t *dict, char *key_prefix) ret = dict_get_str (dict, key, &buffer); if (ret) { - gf_log ("cli", GF_LOG_ERROR, + gf_log ("cli", GF_LOG_INFO, "Unable to get Volume Group"); - goto out; - } - cli_out ("\t%-17s %s %s", "Volume Group", ":", buffer); + cli_out ("\t%-17s %s %s", "Volume Group", ":", "N/A"); + } else + cli_out ("\t%-17s %s %s", "Volume Group", ":", buffer); ret = snprintf (key, sizeof (key), "%s.brick%d.status", key_prefix, i); @@ -8134,11 +8134,11 @@ cli_get_snap_volume_status (dict_t *dict, char *key_prefix) ret = dict_get_str (dict, key, &buffer); if (ret) { - gf_log ("cli", GF_LOG_ERROR, + gf_log ("cli", GF_LOG_INFO, "Unable to get Brick Running"); - goto out; - } - cli_out ("\t%-17s %s %s", "Brick Running", ":", buffer); + cli_out ("\t%-17s %s %s", "Brick Running", ":", "N/A"); + } else + cli_out ("\t%-17s %s %s", "Brick Running", ":", buffer); ret = snprintf (key, sizeof (key), "%s.brick%d.pid", key_prefix, i); @@ -8147,13 +8147,12 @@ cli_get_snap_volume_status (dict_t *dict, char *key_prefix) } ret = dict_get_int32 (dict, key, &pid); - if (!ret) { + if (ret) { + gf_log ("cli", GF_LOG_INFO, + "Unable to get pid"); + cli_out ("\t%-17s %s %s", "Brick PID", ":", "N/A"); + } else cli_out ("\t%-17s %s %d", "Brick PID", ":", pid); - } - else { - cli_out ("\t%-17s %s %s", "Brick PID", ":", - "Brick Process is down"); - } ret = snprintf (key, sizeof (key), "%s.brick%d.data", key_prefix, i); @@ -8163,11 +8162,11 @@ cli_get_snap_volume_status (dict_t *dict, char *key_prefix) ret = dict_get_str (dict, key, &buffer); if (ret) { - gf_log ("cli", GF_LOG_ERROR, + gf_log ("cli", GF_LOG_INFO, "Unable to get Data Percent"); - goto out; - } - cli_out ("\t%-17s %s %s", "Data Percentage", ":", buffer); + cli_out ("\t%-17s %s %s", "Data Percentage", ":", "N/A"); + } else + cli_out ("\t%-17s %s %s", "Data Percentage", ":", buffer); ret = snprintf (key, sizeof (key), "%s.brick%d.lvsize", key_prefix, i); @@ -8176,10 +8175,10 @@ cli_get_snap_volume_status (dict_t *dict, char *key_prefix) } ret = dict_get_str (dict, key, &buffer); if (ret) { - gf_log ("cli", GF_LOG_ERROR, "Unable to get LV Size"); - goto out; - } - cli_out ("\t%-17s %s %s", "LV Size", ":", buffer); + gf_log ("cli", GF_LOG_INFO, "Unable to get LV Size"); + cli_out ("\t%-17s %s %s", "LV Size", ":", "N/A"); + } else + cli_out ("\t%-17s %s %s", "LV Size", ":", buffer); } out : |