summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorGaurav Kumar Garg <garg.gaurav52@gmail.com>2016-02-15 10:48:18 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-02-22 04:01:11 -0800
commit62db11fa017004aa6cb1d91ec6b0117ac3e96a13 (patch)
treea9da3a06d239ef51bb5df8b2ec644bd38f475a7c /xlators
parentf02dc88786afea06e6b064a724803c82a0af90ba (diff)
glusterd: volume should not start when server quorum is not met
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>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index f02ac80ccb0..567b1acc58a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -29,6 +29,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>
@@ -1472,6 +1473,18 @@ glusterd_op_stage_start_volume (dict_t *dict, char **op_errstr,
volname);
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;
+ }
+ }
+
/* This is an incremental approach to have all the volinfo objects ref
* count. The first attempt is made in volume start transaction to
* ensure it doesn't race with import volume where stale volume is
@@ -2511,6 +2524,7 @@ glusterd_op_start_volume (dict_t *dict, char **op_errstr)
volname);
goto out;
}
+
/* This is an incremental approach to have all the volinfo objects ref
* count. The first attempt is made in volume start transaction to
* ensure it doesn't race with import volume where stale volume is