From 5b0f65717f0d9489ca1c8750724cf9c8bfa11cbc Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Fri, 6 Jun 2014 12:48:32 +0000 Subject: glusterd/snapshot: Fix snap delete cleanup During commit the first thing that should happen is the snaps should be marked as GD_SNAP_STATUS_DECOMMISSION. So that if the node goes down the marked snap can be cleaned up when the node is coming back. Also during snap handshake while accepting snapshot from peer, we should check if the snap in question is decomissioned. In that case we shouldn't be accepting the peer data. Change-Id: Ib4e38d1b6bf49411928623fbc9f72f2b37b72086 BUG: 1104714 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/7996 Tested-by: Gluster Build System Reviewed-by: Rajesh Joseph Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- cli/src/cli-rpc-ops.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'cli/src') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 348fbe4e2e..26b6152f2b 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -7648,20 +7648,19 @@ cli_snapshot_remove_reply (gf_cli_rsp *rsp, dict_t *dict) GF_ASSERT (rsp); GF_ASSERT (dict); - if (rsp->op_ret) { - cli_err("snapshot delete: failed: %s", - rsp->op_errstr ? rsp->op_errstr : - "Please check log file for details"); - ret = rsp->op_ret; - goto out; - } - ret = dict_get_str (dict, "snapname", &snap_name); if (ret) { gf_log ("cli", GF_LOG_ERROR, "Failed to get snapname"); goto out; } + if (rsp->op_ret) { + cli_err("snapshot delete: failed: snap %s " + "might not be in an usable state.", snap_name); + ret = rsp->op_ret; + goto out; + } + cli_out ("snapshot delete: %s: snap removed successfully", snap_name); ret = 0; @@ -8303,6 +8302,8 @@ cli_get_snap_volume_status (dict_t *dict, char *key_prefix) cli_out ("\t%-17s %s %s", "LV Size", ":", buffer); } + + ret = 0; out: return ret; } -- cgit