diff options
author | Gaurav Kumar Garg <garg.gaurav52@gmail.com> | 2016-02-22 17:53:53 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-02-23 07:03:05 -0800 |
commit | 794e3e8a7448219e0de303e57b0104896b18746e (patch) | |
tree | b8880e3d42a45af65005a70f5bd214632c643157 /xlators/mgmt | |
parent | 9950884e280e393c2c1bdab189ea3aa1716599e8 (diff) |
glusterd: volume should not start when server quorum is not met
This patch is backport of: http://review.gluster.org/#/c/13442
Currently when server quorum is not met then upon executing
# gluster volume start [force] command its starting the volume.
With this patch if server side quorum is not met then it will
prevent starting of the volume.
>> Change-Id: I39734b2dcf8e90c3c68bf2762d8350aecc82cc38
>> BUG: 1308402
>> Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
>> Reviewed-on: http://review.gluster.org/13442
>> Smoke: Gluster Build System <jenkins@build.gluster.com>
>> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
>> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
>> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Change-Id: Iacb65823fb091e4ac250e436d1cb10103bc24921
BUG: 1310632
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Reviewed-on: http://review.gluster.org/13484
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index d910ad11008..8fd24f943ba 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -34,6 +34,7 @@ #include "glusterd-shd-svc.h" #include "glusterd-snapd-svc.h" #include "glusterd-mgmt.h" +#include "glusterd-server-quorum.h" #include <stdint.h> #include <sys/socket.h> @@ -1451,6 +1452,17 @@ glusterd_op_stage_start_volume (dict_t *dict, char **op_errstr, goto out; } + if (priv->op_version > GD_OP_VERSION_3_7_5) { + ret = glusterd_validate_quorum (this, GD_OP_START_VOLUME, 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; + } + } + ret = glusterd_validate_volume_id (dict, volinfo); if (ret) goto out; |