f338ef
From 5a35a996257d6aaa7fa55ff1e1aac407dd4824fe Mon Sep 17 00:00:00 2001
f338ef
From: Sanju Rakonde <srakonde@redhat.com>
f338ef
Date: Fri, 12 Jul 2019 16:28:04 +0530
f338ef
Subject: [PATCH 252/255] glusterd: do not mark skip_locking as true for
f338ef
 geo-rep operations
f338ef
f338ef
We need to send the commit req to peers in case of geo-rep
f338ef
operations even though it is a no volname operation. In commit
f338ef
phase peers try to set the txn_opinfo which will fail because
f338ef
it is a no volname operation where we don't require a commit
f338ef
phase. We mark skip_locking as true for no volname operations,
f338ef
but we have to give an exception to geo-rep operations, so that
f338ef
they can set txn_opinfo in commit phase.
f338ef
f338ef
Please refer to detailed RCA at the bug: 1729463
f338ef
f338ef
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/23034/
f338ef
f338ef
>fixes: bz#1729463
f338ef
>Change-Id: I9f2478b12a281f6e052035c0563c40543493a3fc
f338ef
>Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
f338ef
f338ef
Change-Id: I9f2478b12a281f6e052035c0563c40543493a3fc
f338ef
BUG: 1727785
f338ef
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
f338ef
Reviewed-on: https://code.engineering.redhat.com/gerrit/176032
f338ef
Tested-by: RHGS Build Bot <nigelb@redhat.com>
f338ef
Reviewed-by: Shwetha Acharya <sacharya@redhat.com>
f338ef
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
f338ef
---
f338ef
 xlators/mgmt/glusterd/src/glusterd-handler.c | 9 +++++++--
f338ef
 1 file changed, 7 insertions(+), 2 deletions(-)
f338ef
f338ef
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
f338ef
index cb2666b..2e73c98 100644
f338ef
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
f338ef
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
f338ef
@@ -1078,7 +1078,11 @@ __glusterd_handle_stage_op(rpcsvc_request_t *req)
f338ef
 
f338ef
     /* In cases where there is no volname, the receivers won't have a
f338ef
      * transaction opinfo created, as for those operations, the locking
f338ef
-     * phase where the transaction opinfos are created, won't be called. */
f338ef
+     * phase where the transaction opinfos are created, won't be called.
f338ef
+     * skip_locking will be true for all such transaction and we clear
f338ef
+     * the txn_opinfo after the staging phase, except for geo-replication
f338ef
+     * operations where we need to access txn_opinfo in the later phases also.
f338ef
+     */
f338ef
     ret = glusterd_get_txn_opinfo(txn_id, &txn_op_info);
f338ef
     if (ret) {
f338ef
         gf_msg_debug(this->name, 0, "No transaction's opinfo set");
f338ef
@@ -1087,7 +1091,8 @@ __glusterd_handle_stage_op(rpcsvc_request_t *req)
f338ef
         glusterd_txn_opinfo_init(&txn_op_info, &state, &op_req.op,
f338ef
                                  req_ctx->dict, req);
f338ef
 
f338ef
-        txn_op_info.skip_locking = _gf_true;
f338ef
+        if (req_ctx->op != GD_OP_GSYNC_SET)
f338ef
+            txn_op_info.skip_locking = _gf_true;
f338ef
         ret = glusterd_set_txn_opinfo(txn_id, &txn_op_info);
f338ef
         if (ret) {
f338ef
             gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_TRANS_OPINFO_SET_FAIL,
f338ef
-- 
f338ef
1.8.3.1
f338ef