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