From 5f3ff9b33c286b30f2c6d2fadf53757b9f48859e Mon Sep 17 00:00:00 2001 From: Gaurav Yadav Date: Fri, 18 Aug 2017 23:06:13 +0530 Subject: glusterd: replace-brick executing successfully when quorum does not met Problem: replace-brick command on a setup where quorum does not met executing successfully. Fix: With the fix glusterd is validating whether server is in quorum or not during replace-brick staging Change-Id: I8017154bb62bdcc6c6490e720ecfe9cde090c161 BUG: 1483058 Signed-off-by: Gaurav Yadav Reviewed-on: https://review.gluster.org/18068 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-replace-brick.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c index 887c3496475..ab38725ffb0 100644 --- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c +++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c @@ -21,6 +21,7 @@ #include "glusterd-nfs-svc.h" #include "glusterd-volgen.h" #include "glusterd-messages.h" +#include "glusterd-server-quorum.h" #include "glusterd-mgmt.h" #include "run.h" #include "syscall.h" @@ -210,6 +211,14 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr, if (ret) goto out; + ret = glusterd_validate_quorum (this, gd_op, dict, op_errstr); + if (ret) { + gf_msg (this->name, GF_LOG_CRITICAL, 0, + GD_MSG_SERVER_QUORUM_NOT_MET, + "Server quorum not met. Rejecting operation."); + goto out; + } + if (strcmp (op, "GF_REPLACE_OP_COMMIT_FORCE")) { ret = -1; goto out; -- cgit