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