summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2015-05-07 14:28:37 -0400
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-05-09 21:14:44 -0700
commit393bc549d92f79f3cff161846bcb22b03b2f6f98 (patch)
treeff830d246f7eda84094a109f01e384cddb2522c2
parent8f267cc87b364970db3444620bb53dc2f50ca13b (diff)
glusterd/tiering: disable tiering if cluster runs older gluster versions
This is a backport of fix 10531 to Gluster 3.7. Do not allow attach or detach tier to work if any of the nodes is running gluster code < 3.7. > http://review.gluster.org/#/c/10531/ > Change-Id: Id9af8f4057f6fad9cb703ec7645bc01eccb11fc1 > BUG: 1218287 > Signed-off-by: Dan Lambright <dlambrig@redhat.com> > Reviewed-on: http://review.gluster.org/10531 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> > Signed-off-by: Dan Lambright <dlambrig@redhat.com> Change-Id: Id9af8f4057f6fad9cb703ec7645bc01eccb11fc1 BUG: 1219600 Signed-off-by: Dan Lambright <dlambrig@redhat.com> Reviewed-on: http://review.gluster.org/10651 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 3699518207b..c2f06ef1cbe 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -27,6 +27,34 @@
/* misc */
+gf_boolean_t
+glusterd_is_tiering_supported (char *op_errstr)
+{
+ xlator_t *this = NULL;
+ glusterd_conf_t *conf = NULL;
+ gf_boolean_t supported = _gf_false;
+
+ this = THIS;
+ GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+
+ conf = this->private;
+ GF_VALIDATE_OR_GOTO (this->name, conf, out);
+
+ if (conf->op_version < GD_OP_VERSION_3_7_0)
+ goto out;
+
+ supported = _gf_true;
+
+out:
+ if (!supported && op_errstr != NULL && conf)
+ sprintf (op_errstr, "Tier operation failed. The cluster is "
+ "operating at version %d. Tiering"
+ " is unavailable in this version.",
+ conf->op_version);
+
+ return supported;
+}
+
/* In this function, we decide, based on the 'count' of the brick,
where to add it in the current volume. 'count' tells us already
how many of the given bricks are added. other argument are self-
@@ -466,6 +494,13 @@ __glusterd_handle_add_brick (rpcsvc_request_t *req)
goto out;
}
+ if (glusterd_is_tiering_supported(err_str) == _gf_false) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Tiering not supported at this version");
+ ret = -1;
+ goto out;
+ }
+
ret = dict_get_int32 (dict, "type", &type);
if (ret) {
gf_log (this->name, GF_LOG_ERROR,
@@ -732,7 +767,6 @@ __glusterd_handle_remove_brick (rpcsvc_request_t *req)
goto out;
}
-
gf_log (this->name, GF_LOG_INFO, "Received rem brick req");
if (cli_req.dict.dict_len) {
@@ -776,6 +810,14 @@ __glusterd_handle_remove_brick (rpcsvc_request_t *req)
goto out;
}
+ if ((volinfo->type == GF_CLUSTER_TYPE_TIER) &&
+ (glusterd_is_tiering_supported(err_str) == _gf_false)) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Tiering not supported at this version");
+ ret = -1;
+ goto out;
+ }
+
ret = dict_get_int32 (dict, "replica-count", &replica_count);
if (!ret) {
gf_log (this->name, GF_LOG_INFO,