diff options
author | Amar Tumballi <amar@gluster.com> | 2011-10-02 13:20:25 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-10-11 03:37:51 -0700 |
commit | 513cd0d12e3b72e9a3714deeee251414e651213f (patch) | |
tree | 9c8bfd6b8b53922d44d824610c904ab1523d6452 /xlators/mgmt/glusterd/src/glusterd-brick-ops.c | |
parent | 18071a240bd4c0d92f583632a7cdef1cd32bbe62 (diff) |
glusterd: take off 'auto-commit' behavior of decommissioning
currently if 'remove-brick <BRICKS> start' is given, after all
the data is migrated, in the _cbk() function from rebalance
complete we used to re-write the volume file without the bricks.
But the flaw of this method is that, currently the _cbk() function
is called on only the node on which rebalance actually happens,
hence other nodes are not aware of this behavior. So, had to remove
the 'auto-commit', instead we want the user to issue a command
'remove-brick <Bricks> commit' (or 'force') explicitely to remove
the bricks
Change-Id: Ifdac1292095029429da502aa6e4c0cf4ee124990
BUG: 1952
Reviewed-on: http://review.gluster.com/551
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index c61d18f664d..3bac37310a8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -842,6 +842,9 @@ glusterd_remove_brick_migrate_cbk (glusterd_volinfo_t *volinfo, gf_defrag_status_t status) { int ret = 0; + +#if 0 /* TODO: enable this behavior once cluster-wide awareness comes for + defrag cbk function */ glusterd_brickinfo_t *brickinfo = NULL; glusterd_brickinfo_t *tmp = NULL; @@ -903,8 +906,10 @@ glusterd_remove_brick_migrate_cbk (glusterd_volinfo_t *volinfo, "Unable to start nfs process (%d)", ret); } +#endif + volinfo->decommission_in_progress = 0; - return 0; + return ret; } @@ -995,6 +1000,8 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) int need_rebalance = 0; int force = 0; gf1_op_commands cmd = 0; + glusterd_brickinfo_t *brickinfo = NULL; + glusterd_brickinfo_t *tmp = NULL; ret = dict_get_str (dict, "volname", &volname); @@ -1037,7 +1044,7 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) } } - /* rebalance '_cbk()' will take care of volume file updates */ + /* no need to update anything */ ret = 0; goto out; } @@ -1054,9 +1061,14 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) } } - /* rebalance '_cbk()' will take care of volume file updates */ + /* Fall back to the old volume file */ + list_for_each_entry_safe (brickinfo, tmp, &volinfo->bricks, brick_list) { + if (!brickinfo->decommissioned) + continue; + brickinfo->decommissioned = 0; + } ret = 0; - goto out; + break; } case GF_OP_CMD_START: @@ -1078,12 +1090,12 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) UNLOCK (&volinfo->defrag->lock); } - ret = 0; /* Graph change happens in rebalance _cbk function, no need to do anything here */ - goto out; + /* TODO: '_cbk' function is not doing anything for now */ } + ret = 0; force = 1; break; } |