summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorKotresh H R <khiremat@redhat.com>2014-04-08 13:50:30 +0530
committerVijay Bellur <vbellur@redhat.com>2014-05-01 08:45:15 -0700
commit4b5ad0d6510d88767762e9c2ef5d028b674a6765 (patch)
treee1366fd6b37c14ae3b047a14cc40ac65366dbebf /glusterfsd
parentc523a04a0bd3edce9cf8ed238b838ebd957f1066 (diff)
features/changelog: Barrier in changelog during snapshot.
Changelog barriers unlink, rename, rmdir fops on barrier 'on' notification from glusterfsd mgmt layer and unbarriers the same on barrier 'off' notification during snapshot. Please see the following link for more details. http://www.gluster.org/community/documentation/index.php/Changelog_Design_changes_for_snapshot Signed-off-by: Kotresh H R <khiremat@redhat.com> Change-Id: Iea9c62fafc86242f9404e03679b1941aa9c88c9a Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/7415 Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Varun Shastry <vshastry@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index b1f00691c8c..0febaf20cbd 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -1219,6 +1219,8 @@ glusterfs_handle_barrier (rpcsvc_request_t *req)
xlator_t *old_THIS = NULL;
dict_t *dict = NULL;
char name[1024] = {0,};
+ gf_boolean_t barrier = _gf_true;
+ gf_boolean_t barrier_err = _gf_false;
GF_ASSERT (req);
@@ -1269,7 +1271,14 @@ glusterfs_handle_barrier (rpcsvc_request_t *req)
brick_rsp.op_ret = ret;
brick_rsp.op_errstr = gf_strdup ("Failed to reconfigure "
"barrier.");
- goto submit_reply;
+ /* This is to invoke changelog-barrier disable if barrier
+ * disable fails and don't invoke if barrier enable fails.
+ */
+ barrier = dict_get_str_boolean (dict, "barrier", _gf_true);
+ if (barrier)
+ goto submit_reply;
+ else
+ barrier_err = _gf_true;
}
/* Reset THIS so that we have it correct in case of an error below
@@ -1277,7 +1286,6 @@ glusterfs_handle_barrier (rpcsvc_request_t *req)
THIS = old_THIS;
/* Send barrier request to changelog as well */
- /* Commenting out the below code till the changelog changes are merged
memset (name, 0, sizeof (name));
snprintf (name, sizeof (name), "%s-changelog", brick_req.name);
@@ -1290,16 +1298,16 @@ glusterfs_handle_barrier (rpcsvc_request_t *req)
}
THIS = xlator;
- ret = xlator->reconfigure (xlator, dict);
-
-
+ ret = xlator->notify (xlator, GF_EVENT_TRANSLATOR_OP, dict);
if (ret) {
brick_rsp.op_ret = ret;
- brick_rsp.op_errstr = gf_strdup ("Failed to reconfigure "
- "changelog.");
+ brick_rsp.op_errstr = gf_strdup ("changelog notify failed");
goto submit_reply;
}
- */
+
+ if (barrier_err)
+ ret = -1;
+
submit_reply:
THIS = old_THIS;