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