summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2011-11-17 14:17:46 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-18 03:01:52 -0800
commit7e085ebc9ca0d34e6251611fdc42dadc243ce276 (patch)
tree4661abb617dee374589c620f7a0de934e05ada52
parent5aadd0765ba4c21b5ef626f7f8ca8ccff530dd2f (diff)
glusterd: Fixed volume profile's "are all bricks down?" algo.
"count" key is not set if no brick in the volume (located across peers) is running. Sending "count" even when zero bricks are running from originator glusterd to client, simplifies "are all bricks down?" algo. Change-Id: I2b1da13ed4b1b9276917908223c9b2c45ca024b3 BUG: 3553 Reviewed-on: http://review.gluster.com/642 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index 853fd931d..22d1bffcf 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -58,6 +58,7 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret,
char *errstr = NULL;
int32_t status = 0;
int32_t is_ctx_dict = 0;
+ int32_t count = 0;
GF_ASSERT (THIS);
@@ -118,6 +119,14 @@ glusterd_op_send_cli_response (glusterd_op_t op, int32_t op_ret,
case GD_OP_SET_VOLUME:
case GD_OP_PROFILE_VOLUME:
{
+ if (dict_get_int32 (ctx, "count", &count)) {
+ ret = dict_set_int32 (ctx, "count", 0);
+ if (ret) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+ "Failed to set brick count");
+ break;
+ }
+ }
is_ctx_dict = 1;
}
case GD_OP_CREATE_VOLUME: