summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2014-06-24 14:19:29 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2014-06-29 23:59:08 -0700
commita9797607a968a4d54d1f28f44048ec5925721098 (patch)
treeee015e216ef02161ddcfae292adaf017a578a3ff /xlators/mgmt
parent187a7a926b6b1b57060046a030a5d9a44000fc4b (diff)
glusterd/snapshot: Fixed errmsg and Quorum check in Snapshot Operation
1) Removing the static message "unbarrier brick opfailed" and log errors / message in places. 2) Calling the Snapshot Volume Quorum check if the commit is passed, as the check(which checks the sanity of glusterds or snapvolume) a successful commit makes more sense. Change-Id: I7b8f77aa9b2e553893a6ae71bd4b5bbbb60ab8f1 BUG: 1112559 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/8158 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mgmt.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
index dab1e691ce3..e93afb27dab 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c
+++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
@@ -1765,7 +1765,7 @@ glusterd_mgmt_v3_initiate_snap_phases (rpcsvc_request_t *req, glusterd_op_t op,
gf_boolean_t is_acquired = _gf_false;
uuid_t *originator_uuid = NULL;
gf_boolean_t success = _gf_false;
- char *tmp_errstr = NULL;
+ char *cli_errstr = NULL;
this = THIS;
GF_ASSERT (this);
@@ -1843,7 +1843,8 @@ glusterd_mgmt_v3_initiate_snap_phases (rpcsvc_request_t *req, glusterd_op_t op,
/* 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");
+ gf_log (this->name, GF_LOG_WARNING,
+ "Volume quorum check failed");
goto out;
}
@@ -1897,7 +1898,7 @@ glusterd_mgmt_v3_initiate_snap_phases (rpcsvc_request_t *req, glusterd_op_t op,
unlock ops also. We might lose the actual error that
caused the failure.
*/
- tmp_errstr = op_errstr;
+ cli_errstr = op_errstr;
op_errstr = NULL;
goto unbarrier;
}
@@ -1922,11 +1923,15 @@ 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;
+ /*Do a quorum check if the commit phase is successful*/
+ if (success) {
+ //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,
+ "Snapshot Volume quorum check failed");
+ goto out;
+ }
}
ret = 0;
@@ -1951,19 +1956,15 @@ out:
npeers, is_acquired);
/* If the commit op (snapshot taking) failed, then the error is stored
- in tmp_errstr and unbarrier is called. Suppose, if unbarrier also
+ in cli_errstr and unbarrier is called. Suppose, if unbarrier also
fails, then the error happened in unbarrier is logged and freed.
- The error happened in commit op, which is stored in tmp_errstr
+ The error happened in commit op, which is stored in cli_errstr
is sent to cli.
*/
- if (tmp_errstr) {
- if (op_errstr) {
- gf_log (this->name, GF_LOG_ERROR, "unbarrier brick op"
- "failed with the error %s", op_errstr);
- GF_FREE (op_errstr);
- op_errstr = NULL;
- }
- op_errstr = tmp_errstr;
+ if (cli_errstr) {
+ GF_FREE (op_errstr);
+ op_errstr = NULL;
+ op_errstr = cli_errstr;
}
/* LOCAL VOLUME(S) UNLOCK */