summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
diff options
context:
space:
mode:
authoranand <anekkunt@redhat.com>2015-12-01 14:30:40 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-12-10 10:20:53 -0800
commit02168fdd1b0d63bac758db2f5e4a53b28e459f97 (patch)
tree97f96a80f90d6323e021da1dc45bdc899786d4aa /xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
parentaeaee78c4ec88f3c00efe22edc796102e03291da (diff)
glusterd: Maintain per transaction op-info object
Issues: Since in op-sm transactions a mix of access to global op-info & per transaction op-info objects are used, the correctness of op-info object may go for a toss resulting into incorrect response getting passed back to cli Fix: Use per transaction op-info object Change-Id: Ice023bace3e137dfd8e7b13bd5b53545a79a203f BUG: 1287027 Signed-off-by: anand <anekkunt@redhat.com> Reviewed-on: http://review.gluster.org/12836 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-rpc-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index fd51255f65b..e670c98a7c9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -784,6 +784,15 @@ __glusterd_cluster_lock_cbk (struct rpc_req *req, struct iovec *iov,
}
out:
+
+ ret = glusterd_set_txn_opinfo (txn_id, &opinfo);
+ if (ret)
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
+ "Unable to set "
+ "transaction's opinfo");
+
+
ret = glusterd_op_sm_inject_event (event_type, txn_id, NULL);
if (!ret) {
@@ -894,6 +903,14 @@ glusterd_mgmt_v3_lock_peers_cbk_fn (struct rpc_req *req, struct iovec *iov,
}
out:
+
+ ret = glusterd_set_txn_opinfo (txn_id, &opinfo);
+ if (ret)
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
+ "Unable to set "
+ "transaction's opinfo");
+
ret = glusterd_op_sm_inject_event (event_type, txn_id, NULL);
if (!ret) {
glusterd_friend_sm ();
@@ -997,6 +1014,14 @@ glusterd_mgmt_v3_unlock_peers_cbk_fn (struct rpc_req *req, struct iovec *iov,
}
out:
+
+ ret = glusterd_set_txn_opinfo (txn_id, &opinfo);
+ if (ret)
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
+ "Unable to set "
+ "transaction's opinfo");
+
ret = glusterd_op_sm_inject_event (event_type, txn_id, NULL);
if (!ret) {
@@ -1095,6 +1120,14 @@ __glusterd_cluster_unlock_cbk (struct rpc_req *req, struct iovec *iov,
}
out:
+
+ ret = glusterd_set_txn_opinfo (txn_id, &opinfo);
+ if (ret)
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
+ "Unable to set "
+ "transaction's opinfo");
+
ret = glusterd_op_sm_inject_event (event_type, txn_id, NULL);
if (!ret) {
@@ -1229,6 +1262,13 @@ out:
rcu_read_unlock ();
+ ret = glusterd_set_txn_opinfo (txn_id, &opinfo);
+ if (ret)
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
+ "Unable to set "
+ "transaction's opinfo");
+
ret = glusterd_op_sm_inject_event (event_type, txn_id, NULL);
if (!ret) {
@@ -1404,6 +1444,14 @@ unlock:
rcu_read_unlock ();
out:
+
+ ret = glusterd_set_txn_opinfo (txn_id, &opinfo);
+ if (ret)
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
+ "Unable to set "
+ "transaction's opinfo");
+
ret = glusterd_op_sm_inject_event (event_type, txn_id, NULL);
if (!ret) {
@@ -2188,6 +2236,7 @@ glusterd_brick_op (call_frame_t *frame, xlator_t *this,
gd1_mgmt_brick_op_req *req = NULL;
int ret = 0;
+ int ret1 = 0;
glusterd_conf_t *priv = NULL;
call_frame_t *dummy_frame = NULL;
char *op_errstr = NULL;
@@ -2311,6 +2360,17 @@ glusterd_brick_op (call_frame_t *frame, xlator_t *this,
opinfo.brick_pending_count = pending_bricks;
out:
+
+ if (ret)
+ opinfo.op_ret = ret;
+
+ ret1 = glusterd_set_txn_opinfo (txn_id, &opinfo);
+ if (ret1)
+ gf_msg (THIS->name, GF_LOG_ERROR, 0,
+ GD_MSG_TRANS_OPINFO_SET_FAIL,
+ "Unable to set "
+ "transaction's opinfo");
+
if (ret) {
glusterd_op_sm_inject_event (GD_OP_EVENT_RCVD_RJT,
txn_id, data);