glusterd: gluster command should retrieve current op-version of the NODE

Problem:
glusterd was failing to get some specific volume option. for eg:
gluster volume get <vol-name> cluster.op-version

Fix:
glusterd should set count value in dictionary while retrieving specific volume
option.

Change-Id: Iada768ea3d8a0006895525eca2c2dcc40432a4ea
BUG: 1199451
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/9821
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
This commit is contained in:
Gaurav Kumar Garg 2015-03-06 16:11:16 +05:30 committed by Kaushal M
parent 59b1c24c81
commit 2b949eb89e
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,22 @@
#!/bin/bash
## Test case for BZ-1199451 (gluster command should retrieve current op-version
## of the NODE)
. $(dirname $0)/../../include.rc
. $(dirname $0)/../../volume.rc
cleanup;
## Start glusterd
TEST glusterd
TEST pidof glusterd
## Lets create and start volume
TEST $CLI volume create $V0 $H0:$B0/brick1 $H0:$B0/brick2
TEST $CLI volume start $V0
## glusterd command should retrieve current op-version of the node
TEST $CLI volume get $V0 cluster.op-version
cleanup;

View File

@ -4361,6 +4361,16 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict)
" details", key);
}
}
/* Request is for a single option, explicitly set count to 1
* in the dictionary.
*/
ret = dict_set_int32 (dict, "count", 1);
if (ret) {
gf_log (this->name, GF_LOG_ERROR, "Failed to set count "
"value in the dictionary");
goto out;
}
} else {
/* Handle the "all" volume option request */
ret = glusterd_get_default_val_for_volopt (dict, _gf_true, NULL,