Skip to content

Commit

Permalink
IGNITE-23843 Remove IgniteFeatures#SUSPEND_RESUME_PESSIMISTIC_TX and …
Browse files Browse the repository at this point in the history
…related code (#11701)
  • Loading branch information
nizhikov authored Dec 9, 2024
1 parent db3e946 commit a3d93a9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,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),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
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;
Expand Down Expand Up @@ -143,7 +142,6 @@
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;
Expand Down Expand Up @@ -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<>();
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -2640,11 +2623,6 @@ public Collection<IgniteInternalFuture<?>> deadlockDetectionFutures() {
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() + ']');
Expand Down

0 comments on commit a3d93a9

Please sign in to comment.