diff options
author | Krishnan Parthasarathi <kp@gluster.com> | 2012-01-02 18:40:31 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-01-02 20:49:58 -0800 |
commit | 29b9b0c72809456b1ba334a40adc1ed9929eca91 (patch) | |
tree | 5dc257a07d2bb9589d1a0a4e81000f2153af72e0 /xlators/mgmt/glusterd | |
parent | be003fbb3ac7a1f1021774ecb75a4929f1ba85d4 (diff) |
glusterd: Fixed add-brick handler algorithm.
In the fix for 765774, setting the op dictionary with modified stripe
and replica count was (accidentally) removed affecting the correctness.
The stage and op functions of add-brick rely on the fact that stripe/replica
count are zero if there is no change in them during the add-brick operation.
Change-Id: I55a23878e618b355009ffd0fce8c4904dbb70691
BUG: 770914
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/2548
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 26136263ce3..6d746ef912d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -431,6 +431,12 @@ glusterd_handle_add_brick (rpcsvc_request_t *req) if (ret == 1) stripe_count = 0; + ret = dict_set_int32 (dict, "stripe-count", stripe_count); + if (ret) { + gf_log (THIS->name, GF_LOG_ERROR, + "failed to set the stripe-count in dict"); + goto out; + } goto brick_val; } @@ -447,6 +453,13 @@ glusterd_handle_add_brick (rpcsvc_request_t *req) if (ret == 1) replica_count = 0; + ret = dict_set_int32 (dict, "replica-count", replica_count); + if (ret) { + gf_log (THIS->name, GF_LOG_ERROR, + "failed to set the replica-count in dict"); + goto out; + } + brick_val: ret = dict_get_str (dict, "bricks", &bricks); if (ret) { |