50dc83
From bd087c3d2766b81b25ea7bbe425b55023fd12545 Mon Sep 17 00:00:00 2001
50dc83
From: Sanju Rakonde <srakonde@redhat.com>
50dc83
Date: Wed, 15 May 2019 07:35:45 +0530
50dc83
Subject: [PATCH 159/169] glusterd: add an op-version check
50dc83
50dc83
Problem: "gluster v status" is hung in heterogenous cluster
50dc83
when issued from a non-upgraded node.
50dc83
50dc83
Cause: commit 34e010d64 fixes the txn-opinfo mem leak
50dc83
in op-sm framework by not setting the txn-opinfo if some
50dc83
conditions are true. When vol status is issued from a
50dc83
non-upgraded node, command is hanging in its upgraded peer
50dc83
as the upgraded node setting the txn-opinfo based on new
50dc83
conditions where as non-upgraded nodes are following diff
50dc83
conditions.
50dc83
50dc83
Fix: Add an op-version check, so that all the nodes follow
50dc83
same set of conditions to set txn-opinfo.
50dc83
50dc83
upstream patch: https://review.gluster.org/#/c/glusterfs/+/22730/
50dc83
50dc83
BUG: 1707246
50dc83
50dc83
> fixes: bz#1710159
50dc83
> Change-Id: Ie1f353212c5931ddd1b728d2e6949dfe6225c4ab
50dc83
> Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
50dc83
50dc83
Change-Id: Ie1f353212c5931ddd1b728d2e6949dfe6225c4ab
50dc83
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
50dc83
Reviewed-on: https://code.engineering.redhat.com/gerrit/172307
50dc83
Tested-by: RHGS Build Bot <nigelb@redhat.com>
50dc83
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
50dc83
---
50dc83
 xlators/mgmt/glusterd/src/glusterd-op-sm.c | 6 +++++-
50dc83
 1 file changed, 5 insertions(+), 1 deletion(-)
50dc83
50dc83
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
50dc83
index 94a5e1f..d0c1a2c 100644
50dc83
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
50dc83
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
50dc83
@@ -8158,9 +8158,12 @@ glusterd_op_sm()
50dc83
     glusterd_op_sm_event_type_t event_type = GD_OP_EVENT_NONE;
50dc83
     xlator_t *this = NULL;
50dc83
     glusterd_op_info_t txn_op_info;
50dc83
+    glusterd_conf_t *priv = NULL;
50dc83
 
50dc83
     this = THIS;
50dc83
     GF_ASSERT(this);
50dc83
+    priv = this->private;
50dc83
+    GF_ASSERT(priv);
50dc83
 
50dc83
     ret = synclock_trylock(&gd_op_sm_lock);
50dc83
     if (ret) {
50dc83
@@ -8238,7 +8241,8 @@ glusterd_op_sm()
50dc83
                            "Unable to clear "
50dc83
                            "transaction's opinfo");
50dc83
             } else {
50dc83
-                if (!(event_type == GD_OP_EVENT_STAGE_OP &&
50dc83
+                if ((priv->op_version < GD_OP_VERSION_6_0) ||
50dc83
+                    !(event_type == GD_OP_EVENT_STAGE_OP &&
50dc83
                       opinfo.state.state == GD_OP_STATE_STAGED &&
50dc83
                       opinfo.skip_locking)) {
50dc83
                     ret = glusterd_set_txn_opinfo(&event->txn_id, &opinfo);
50dc83
-- 
50dc83
1.8.3.1
50dc83