summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-mgmt.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2014-04-14 11:24:12 +0530
committerKaushal M <kaushal@redhat.com>2014-05-07 23:51:49 -0700
commitb47b46d98a5e1d3e6e9eb9bde4f81b745f2ac09d (patch)
treee67644b7c71d5e74f09fec015325087c07b90304 /xlators/mgmt/glusterd/src/glusterd-mgmt.c
parenteeb4434d6196735323fa28cfd19b5f7b36e1f664 (diff)
mgmt/glusterd: quorum check before taking the snapshot
without force option: quorum fails if glusterds are not in quorum. If glusterd are in quorum, then volume quorum (i.e quorum of the bricks) is checked. volume quorum fails even if one of the bricks are down. with force option: even though the glusterds are not in quorum, and some bricks are down, the quorum check of the volume (i.e bricks) is done and if the volume quorum is met, snapshot is taken. Change-Id: I06971e45d5cf09880032ef038bfe011e6c244268 BUG: 1061685 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/7463 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-mgmt.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mgmt.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
index 9e0e9e024ca..dab1e691ce3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c
+++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
@@ -1840,6 +1840,13 @@ glusterd_mgmt_v3_initiate_snap_phases (rpcsvc_request_t *req, glusterd_op_t op,
goto out;
}
+ /* quorum check of the volume is done here */
+ ret = glusterd_snap_quorum_check (req_dict, _gf_false, &op_errstr);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING, "quorum check failed");
+ goto out;
+ }
+
/* Set the operation type as pre, so that differentiation can be
* made whether the brickop is sent during pre-commit or post-commit
*/
@@ -1915,6 +1922,13 @@ unbarrier:
goto out;
}
+ // quorum check of the snapshot volume
+ ret = glusterd_snap_quorum_check (dict, _gf_true, &op_errstr);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING, "quorum check failed");
+ goto out;
+ }
+
ret = 0;
out: