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