diff options
author | Kaushal M <kaushal@redhat.com> | 2013-05-16 16:03:52 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-07-02 19:18:26 -0700 |
commit | 7fd38981278c8a51587f1db5b59f8cfeed5c6e5a (patch) | |
tree | 79515aff453c46a47aa01b00ff38641e78b1faed /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 979a17d49a8dc9a19d9f3a466c137d5cf2c79a07 (diff) |
glusterd: More checks before starting rebalance/remove-brick
Check if a previous remove-brick operation has been committed before
starting a new rebalance/remove-brick task.
Change-Id: I553e5ba64a6a352ca91032ab1a17997051a4494e
BUG: 963541
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/5019
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 7e822594ed8..a772ad67a62 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -7630,3 +7630,16 @@ gd_update_volume_op_versions (glusterd_volinfo_t *volinfo) return; } + +/* A task is committed/completed once the task-id for it is cleared */ +gf_boolean_t +gd_is_remove_brick_committed (glusterd_volinfo_t *volinfo) +{ + GF_ASSERT (volinfo); + + if ((GD_OP_REMOVE_BRICK == volinfo->rebal.op) && + !uuid_is_null (volinfo->rebal.rebalance_id)) + return _gf_false; + + return _gf_true; +} |