summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.h
diff options
context:
space:
mode:
authorSamikshan Bairagya <samikshan@gmail.com>2016-12-19 15:07:14 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-01-08 21:16:12 -0800
commit76fbeafbf56a61768c81f622b354e3c95a00e986 (patch)
tree0b8959761c59a86067368b6883feef2240578fbe /xlators/mgmt/glusterd/src/glusterd-utils.h
parent3fcd790d9ca01a95026026d64385c52b5476174d (diff)
glusterd: Get maximum supported op-version in a cluster
gluster volume get <VOLNAME> cluster.opversion gives us the current op-version on which the cluster is operating. There is no command that lets the user know the maximum supported op-version that the cluster can run on. This patch adds a new global option cluster.max-op-version, that can be used to retrieve the maximum supported op-version in a cluster. Usage: # gluster volume get all cluster.max-op-version Example output: Option Value ------ ----- cluster.max-op-version 30900 NOTE: The only way to test this feature for now is to set the GD_OP_VERSION_MAX macro to different values (30800 for 3.8,30900 for 3.9, and so on) and rebuild glusterd. Since the regression test framework currently doesn't have support to simulate these tests, there are no accompanying regression tests for this feature. It should be possible to add tests once glusto comes in and makes it easier to run a heterogeneous cluster. Change-Id: I547480ee5e7912664784643e436feb198b6d16d0 BUG: 1365822 Signed-off-by: Samikshan Bairagya <samikshan@gmail.com> Reviewed-on: http://review.gluster.org/16283 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h
index 914d7977b51..53f4d971998 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -38,9 +38,11 @@
gf_boolean_t _is_valid_opt = _gf_false; \
int32_t i = 0; \
\
- if (strcmp (key, "all") == 0 && !get_opt) { \
+ if (!get_opt && (!strcmp (key, "all") || \
+ !strcmp (key, "cluster.max-op-version"))) { \
ret = -1; \
*op_errstr = gf_strdup ("Not a valid option to set"); \
+ goto out; \
} \
\
for (i = 0; valid_all_vol_opts[i].option; i++) { \
@@ -482,6 +484,9 @@ glusterd_handle_node_rsp (dict_t *req_ctx, void *pending_entry,
glusterd_op_t op, dict_t *rsp_dict, dict_t *op_ctx,
char **op_errstr, gd_node_type type);
int
+glusterd_max_opversion_use_rsp_dict (dict_t *dst, dict_t *src);
+
+int
glusterd_volume_bitrot_scrub_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict);
int
@@ -657,7 +662,12 @@ int
glusterd_get_volopt_content (dict_t *dict, gf_boolean_t xml_out);
int
-glusterd_get_global_options_for_all_vols (dict_t *dict, char **op_errstr);
+glusterd_get_global_max_op_version (rpcsvc_request_t *req, dict_t *ctx,
+ int count);
+
+int
+glusterd_get_global_options_for_all_vols (rpcsvc_request_t *req, dict_t *dict,
+ char **op_errstr);
int
glusterd_get_default_val_for_volopt (dict_t *dict, gf_boolean_t all_opts,