You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sk...@apache.org on 2021/01/29 18:54:53 UTC
[ignite] branch master updated: IGNITE-14100
GridCachePartitionedNodeRestartTest fails due to wrong tx mapping. Fixes
#8727
This is an automated email from the ASF dual-hosted git repository.
sk0x50 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 9052956 IGNITE-14100 GridCachePartitionedNodeRestartTest fails due to wrong tx mapping. Fixes #8727
9052956 is described below
commit 90529561461c71d35de7cffb384e290eaa52b3f1
Author: Alexander Lapin <la...@gmail.com>
AuthorDate: Fri Jan 29 21:54:06 2021 +0300
IGNITE-14100 GridCachePartitionedNodeRestartTest fails due to wrong tx mapping. Fixes #8727
Signed-off-by: Slava Koptilin <sl...@gmail.com>
---
.../cache/distributed/dht/GridDhtTxPrepareFuture.java | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 5afa379..b5ccbd7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -61,6 +61,8 @@ import org.apache.ignite.internal.processors.cache.GridCacheVersionedFuture;
import org.apache.ignite.internal.processors.cache.KeyCacheObject;
import org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheEntry;
import org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxMapping;
+import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtLocalPartition;
+import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionTopology;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheAdapter;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareRequest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareResponse;
@@ -1639,7 +1641,7 @@ public final class GridDhtTxPrepareFuture extends GridCacheCompoundFuture<Ignite
/**
* @param entry Transaction entry.
*/
- private void map(IgniteTxEntry entry) {
+ private void map(IgniteTxEntry entry) throws IgniteTxRollbackCheckedException {
if (entry.cached().isLocal())
return;
@@ -1661,6 +1663,21 @@ public final class GridDhtTxPrepareFuture extends GridCacheCompoundFuture<Ignite
try {
List<ClusterNode> dhtNodes = dht.topology().nodes(cached.partition(), tx.topologyVersion());
+ GridDhtPartitionTopology top = cacheCtx.topology();
+
+ GridDhtLocalPartition part = top.localPartition(cached.partition());
+
+ if (part != null && !part.primary(top.readyTopologyVersion())) {
+ log.warning("Failed to map a transaction on outdated topology, rolling back " +
+ "[tx=" + CU.txString(tx) +
+ ", readyTopVer=" + top.readyTopologyVersion() +
+ ", lostParts=" + top.lostPartitions() +
+ ", part=" + part.toString() + ']');
+
+ throw new IgniteTxRollbackCheckedException("Failed to map a transaction on outdated " +
+ "topology, please try again [timeout=" + tx.timeout() + ", tx=" + CU.txString(tx) + ']');
+ }
+
assert !dhtNodes.isEmpty() && dhtNodes.get(0).id().equals(cctx.localNodeId()) :
"cacheId=" + cacheCtx.cacheId() + ", localNode = " + cctx.localNodeId() + ", dhtNodes = " + dhtNodes;