This is an automated email from the ASF dual-hosted git repository. nizhikov pushed a commit to branch IGNITE-23843 in repository https://gitbox.apache.org/repos/asf/ignite.git
commit 15735097fe69d096c3abaf10a58e47efe8cb879c Author: Nikolay Izhikov <[email protected]> AuthorDate: Wed Dec 4 15:03:02 2024 +0300 IGNITE-23841 Remove IgniteFeatures#SUSPEND_RESUME_PESSIMISTIC_TX and related code --- .../org/apache/ignite/internal/IgniteFeatures.java | 3 --- .../cache/transactions/IgniteTxManager.java | 22 ---------------------- 2 files changed, 25 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 55813c124ce..53ea8a6c5a7 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 @@ -50,9 +50,6 @@ public enum IgniteFeatures { /** Support of splitted cache configurations to avoid broken deserialization on non-affinity nodes. */ SPLITTED_CACHE_CONFIGURATIONS(5), - /** Support of suspend/resume operations for pessimistic transactions. */ - SUSPEND_RESUME_PESSIMISTIC_TX(10), - /** Distributed metastorage. */ DISTRIBUTED_METASTORAGE(11), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java index 3920585f00b..40c3881ef9d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java @@ -49,7 +49,6 @@ import org.apache.ignite.configuration.TransactionConfiguration; import org.apache.ignite.events.DiscoveryEvent; import org.apache.ignite.failure.FailureContext; import org.apache.ignite.failure.FailureType; -import org.apache.ignite.internal.IgniteFeatures; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; import org.apache.ignite.internal.cluster.DistributedTransactionConfiguration; @@ -143,7 +142,6 @@ import static org.apache.ignite.internal.processors.cache.transactions.IgniteInt import static org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx.FinalizationStatus.USER_FINISH; import static org.apache.ignite.internal.processors.security.SecurityUtils.securitySubjectId; import static org.apache.ignite.internal.util.GridConcurrentFactory.newMap; -import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC; import static org.apache.ignite.transactions.TransactionState.ACTIVE; import static org.apache.ignite.transactions.TransactionState.COMMITTED; import static org.apache.ignite.transactions.TransactionState.COMMITTING; @@ -279,12 +277,6 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter { /** TxDeadlock detection. */ private TxDeadlockDetection txDeadlockDetection; - /** - * Indicates whether {@code suspend()} and {@code resume()} operations are supported for pessimistic transactions - * cluster wide. - */ - private volatile boolean suspendResumeForPessimisticSupported; - /** The futures for changing transaction timeout on partition map exchange. */ private final ConcurrentMap<UUID, TxTimeoutOnPartitionMapExchangeChangeFuture> txTimeoutOnPartitionMapExchangeFuts = new ConcurrentHashMap<>(); @@ -371,9 +363,6 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter { removeTxReturn(entry.getKey()); } } - - suspendResumeForPessimisticSupported = IgniteFeatures.allNodesSupports( - cctx.discovery().remoteNodes(), IgniteFeatures.SUSPEND_RESUME_PESSIMISTIC_TX); }, EVT_NODE_FAILED, EVT_NODE_LEFT, EVT_NODE_JOINED); @@ -410,12 +399,6 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter { TransactionView::new); } - /** {@inheritDoc} */ - @Override protected void onKernalStart0(boolean active) { - suspendResumeForPessimisticSupported = IgniteFeatures.allNodesSupports( - cctx.discovery().remoteNodes(), IgniteFeatures.SUSPEND_RESUME_PESSIMISTIC_TX); - } - /** * @param cacheId Cache ID. */ @@ -2640,11 +2623,6 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter { public void suspendTx(final GridNearTxLocal tx) throws IgniteCheckedException { assert tx != null && !tx.system() : tx; - if (tx.concurrency == PESSIMISTIC && !suspendResumeForPessimisticSupported) { - throw new IgniteCheckedException("Suspend operation cannot be called " + - "because some nodes in the cluster don't support this feature."); - } - if (!tx.state(SUSPENDED)) { throw new IgniteCheckedException("Trying to suspend transaction with incorrect state " + "[expected=" + ACTIVE + ", actual=" + tx.state() + ']');
