ca3909
From 90e52f3b44da0ed05e35ebd474e284d45794b0d6 Mon Sep 17 00:00:00 2001
ca3909
From: Sanju Rakonde <srakonde@redhat.com>
ca3909
Date: Thu, 10 Oct 2019 20:40:49 +0530
ca3909
Subject: [PATCH 305/307] glusterd: rebalance start should fail when quorum is
ca3909
 not met
ca3909
ca3909
rebalance start should not succeed if quorum is not met.
ca3909
this patch adds a condition to check whether quorum is met
ca3909
in pre-validation stage.
ca3909
ca3909
> fixes: bz#1760467
ca3909
> Change-Id: Ic7d0d08f69e4bc6d5e7abae713ec1881531c8ad4
ca3909
> Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
ca3909
ca3909
upstream patch: https://review.gluster.org/#/c/glusterfs/+/23536/
ca3909
BUG: 1760261
ca3909
Change-Id: Ic7d0d08f69e4bc6d5e7abae713ec1881531c8ad4
ca3909
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
ca3909
Reviewed-on: https://code.engineering.redhat.com/gerrit/183146
ca3909
Tested-by: RHGS Build Bot <nigelb@redhat.com>
ca3909
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
ca3909
---
ca3909
 tests/bugs/glusterd/quorum-validation.t   | 2 ++
ca3909
 xlators/mgmt/glusterd/src/glusterd-mgmt.c | 3 ++-
ca3909
 2 files changed, 4 insertions(+), 1 deletion(-)
ca3909
ca3909
diff --git a/tests/bugs/glusterd/quorum-validation.t b/tests/bugs/glusterd/quorum-validation.t
ca3909
index ff46729..3cc3351 100644
ca3909
--- a/tests/bugs/glusterd/quorum-validation.t
ca3909
+++ b/tests/bugs/glusterd/quorum-validation.t
ca3909
@@ -34,6 +34,8 @@ TEST ! $CLI_1 volume add-brick $V0 $H1:$B1/${V0}2
ca3909
 TEST ! $CLI_1 volume remove-brick $V0 $H1:$B1/${V0}0 start
ca3909
 TEST ! $CLI_1 volume set $V0 barrier enable
ca3909
 
ca3909
+#quorum is not met, rebalance/profile start should fail
ca3909
+TEST ! $CLI_1 volume rebalance $V0 start
ca3909
 TEST ! $CLI_1 volume profile $V0 start
ca3909
 
ca3909
 #bug-1690753 - Volume stop when quorum not met is successful
ca3909
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
ca3909
index ec78913..a4915f3 100644
ca3909
--- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c
ca3909
+++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
ca3909
@@ -1059,7 +1059,8 @@ glusterd_mgmt_v3_pre_validate(glusterd_op_t op, dict_t *req_dict,
ca3909
         goto out;
ca3909
     }
ca3909
 
ca3909
-    if (op == GD_OP_PROFILE_VOLUME || op == GD_OP_STOP_VOLUME) {
ca3909
+    if (op == GD_OP_PROFILE_VOLUME || op == GD_OP_STOP_VOLUME ||
ca3909
+        op == GD_OP_REBALANCE) {
ca3909
         ret = glusterd_validate_quorum(this, op, req_dict, op_errstr);
ca3909
         if (ret) {
ca3909
             gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SERVER_QUORUM_NOT_MET,
ca3909
-- 
ca3909
1.8.3.1
ca3909