You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ni...@apache.org on 2024/12/09 11:50:07 UTC

(ignite) branch master updated: IGNITE-23842 Remove IgniteFeatures#TRANSACTION_OWNER_THREAD_DUMP_PROVIDING and related code (#11700)

This is an automated email from the ASF dual-hosted git repository.

nizhikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new db3e9468552 IGNITE-23842 Remove IgniteFeatures#TRANSACTION_OWNER_THREAD_DUMP_PROVIDING and related code (#11700)
db3e9468552 is described below

commit db3e9468552473d04a4a5645dafc35d7e47bf204
Author: Nikolay <ni...@apache.org>
AuthorDate: Mon Dec 9 14:49:59 2024 +0300

    IGNITE-23842 Remove IgniteFeatures#TRANSACTION_OWNER_THREAD_DUMP_PROVIDING and related code (#11700)
---
 .../org/apache/ignite/internal/IgniteFeatures.java |  6 --
 .../cache/GridCachePartitionExchangeManager.java   | 95 +++++++++-------------
 2 files changed, 40 insertions(+), 61 deletions(-)

diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
index 82814348793..d729bd00674 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
@@ -47,12 +47,6 @@ public enum IgniteFeatures {
     /** Support of splitted cache configurations to avoid broken deserialization on non-affinity nodes. */
     SPLITTED_CACHE_CONFIGURATIONS(5),
 
-    /**
-     * Support of providing thread dump of thread that started transaction. Used for dumping
-     * long running transactions.
-     */
-    TRANSACTION_OWNER_THREAD_DUMP_PROVIDING(6),
-
     /** Support of suspend/resume operations for pessimistic transactions. */
     SUSPEND_RESUME_PESSIMISTIC_TX(10),
 
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index b2971b859c1..e604dfdcdb2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -54,7 +54,6 @@ import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.cache.CacheRebalanceMode;
 import org.apache.ignite.cache.affinity.AffinityFunction;
 import org.apache.ignite.cluster.BaselineNode;
-import org.apache.ignite.cluster.ClusterGroup;
 import org.apache.ignite.cluster.ClusterGroupEmptyException;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.cluster.ClusterState;
@@ -172,8 +171,6 @@ import static org.apache.ignite.failure.FailureType.CRITICAL_ERROR;
 import static org.apache.ignite.failure.FailureType.SYSTEM_WORKER_TERMINATION;
 import static org.apache.ignite.internal.GridClosureCallMode.BALANCE;
 import static org.apache.ignite.internal.GridTopic.TOPIC_CACHE;
-import static org.apache.ignite.internal.IgniteFeatures.TRANSACTION_OWNER_THREAD_DUMP_PROVIDING;
-import static org.apache.ignite.internal.IgniteFeatures.allNodesSupports;
 import static org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT;
 import static org.apache.ignite.internal.managers.communication.GridIoPolicy.SYSTEM_POOL;
 import static org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion.NONE;
@@ -784,7 +781,6 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
         }
 
         GridKernalContext ctx = cctx.kernalContext();
-        DiscoveryDataClusterState state = ctx.state().clusterState();
 
         if (baselineChanging) {
             ctx.pools().getStripedExecutorService().execute(new Runnable() {
@@ -2343,66 +2339,55 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
 
             IgniteEx ignite = cctx.kernalContext().grid();
 
-            ClusterGroup nearNode = ignite.cluster().forNodeId(nearNodeId);
-
             String txReqInfo = String.format(
                 "[xidVer=%s, nodeId=%s]",
                 tx.xidVersion().toString(),
                 nearNodeId.toString()
             );
 
-            if (allNodesSupports(nearNode.nodes(), TRANSACTION_OWNER_THREAD_DUMP_PROVIDING)) {
-                try {
-                    ignite.context().closure()
-                        .callAsync(
-                            BALANCE,
-                            new FetchActiveTxOwnerTraceClosure(txOwnerThreadId),
-                            options(ignite.cluster().forNodeId(nearNodeId).nodes())
-                        ).listen(new IgniteInClosure<IgniteInternalFuture<String>>() {
-                            @Override public void apply(IgniteInternalFuture<String> strIgniteFut) {
-                                String traceDump = null;
-
-                                try {
-                                    traceDump = strIgniteFut.get();
-                                }
-                                catch (ClusterGroupEmptyException e) {
-                                    U.error(
-                                        diagnosticLog,
-                                        "Could not get thread dump from transaction owner because near node " +
-                                                "is out of topology now. " + txReqInfo
-                                    );
-                                }
-                                catch (Exception e) {
-                                    U.error(
-                                        diagnosticLog,
-                                        "Could not get thread dump from transaction owner near node " + txReqInfo,
-                                        e
-                                    );
-                                }
+            try {
+                ignite.context().closure()
+                    .callAsync(
+                        BALANCE,
+                        new FetchActiveTxOwnerTraceClosure(txOwnerThreadId),
+                        options(ignite.cluster().forNodeId(nearNodeId).nodes())
+                    ).listen(new IgniteInClosure<IgniteInternalFuture<String>>() {
+                        @Override public void apply(IgniteInternalFuture<String> strIgniteFut) {
+                            String traceDump = null;
+
+                            try {
+                                traceDump = strIgniteFut.get();
+                            }
+                            catch (ClusterGroupEmptyException e) {
+                                U.error(
+                                    diagnosticLog,
+                                    "Could not get thread dump from transaction owner because near node " +
+                                            "is out of topology now. " + txReqInfo
+                                );
+                            }
+                            catch (Exception e) {
+                                U.error(
+                                    diagnosticLog,
+                                    "Could not get thread dump from transaction owner near node " + txReqInfo,
+                                    e
+                                );
+                            }
 
-                                if (traceDump != null) {
-                                    U.warn(
-                                        diagnosticLog,
-                                        String.format(
-                                            "Dumping the near node thread that started transaction %s\n%s",
-                                            txReqInfo,
-                                            traceDump
-                                        )
-                                    );
-                                }
+                            if (traceDump != null) {
+                                U.warn(
+                                    diagnosticLog,
+                                    String.format(
+                                        "Dumping the near node thread that started transaction %s\n%s",
+                                        txReqInfo,
+                                        traceDump
+                                    )
+                                );
                             }
-                        });
-                }
-                catch (Exception e) {
-                    U.error(diagnosticLog, "Could not send dump request to transaction owner near node " + txReqInfo, e);
-                }
+                        }
+                    });
             }
-            else {
-                U.warn(
-                    diagnosticLog,
-                    "Could not send dump request to transaction owner near node: node does not support this feature. " +
-                        txReqInfo
-                );
+            catch (Exception e) {
+                U.error(diagnosticLog, "Could not send dump request to transaction owner near node " + txReqInfo, e);
             }
         }
     }