/** {@inheritDoc} */ @Override public final void prepare() { // Obtain the topology version to use. long threadId = Thread.currentThread().getId(); AffinityTopologyVersion topVer = cctx.mvcc().lastExplicitLockTopologyVersion(threadId); // If there is another system transaction in progress, use it's topology version to prevent deadlock. if (topVer == null && tx.system()) { topVer = cctx.tm().lockedTopologyVersion(threadId, tx); if (topVer == null) topVer = tx.topologyVersionSnapshot(); } if (topVer != null) { tx.topologyVersion(topVer); cctx.mvcc().addFuture(this); prepare0(false, true); return; } prepareOnTopology(false, null); }
/** */ private boolean isLocalBackup(EnlistOperation op, KeyCacheObject key) { if (!cctx.affinityNode() || op == EnlistOperation.LOCK) return false; else if (cctx.isReplicated()) return true; return cctx.topology().nodes(key.partition(), tx.topologyVersion()).indexOf(cctx.localNode()) > 0; }
tx.topologyVersion(topVer);
/** */ private boolean isLocalBackup(EnlistOperation op, KeyCacheObject key) { if (!cctx.affinityNode() || op == EnlistOperation.LOCK) return false; else if (cctx.isReplicated()) return true; return cctx.topology().nodes(key.partition(), tx.topologyVersion()).contains(cctx.localNode()); }
tx.topologyVersion(topVer);
/** {@inheritDoc} */ @Override public boolean onNodeLeft(UUID nodeId) { boolean found = false; for (IgniteInternalFuture<?> fut : futures()) { if (fut instanceof MiniFuture) { MiniFuture f = (MiniFuture)fut; if (f.primary().id().equals(nodeId)) { ClusterTopologyCheckedException e = new ClusterTopologyCheckedException("Remote node left grid: " + nodeId); e.retryReadyFuture(cctx.nextAffinityReadyFuture(tx.topologyVersion())); f.onNodeLeft(e); found = true; } } } return found; }
/** {@inheritDoc} */ @Override public boolean onNodeLeft(UUID nodeId) { boolean found = false; for (IgniteInternalFuture<?> fut : futures()) { if (isMini(fut)) { MiniFuture f = (MiniFuture) fut; if (f.node().id().equals(nodeId)) { ClusterTopologyCheckedException e = new ClusterTopologyCheckedException("Remote node left grid: " + nodeId); e.retryReadyFuture(cctx.nextAffinityReadyFuture(tx.topologyVersion())); f.onNodeLeft(e, true); found = true; } } } return found; }
/** {@inheritDoc} */ @Override public boolean onNodeLeft(UUID nodeId) { boolean found = false; for (IgniteInternalFuture<?> fut : futures()) { if (isMini(fut)) { MiniFuture f = (MiniFuture) fut; if (f.primary().id().equals(nodeId)) { ClusterTopologyCheckedException e = new ClusterTopologyCheckedException("Remote node left grid: " + nodeId); e.retryReadyFuture(cctx.nextAffinityReadyFuture(tx.topologyVersion())); f.onNodeLeft(e); found = true; } } } return found; }
tx.topologyVersion(topVer);
"GridNearOptimisticTxPrepareFuture waiting for remote node response [" + "nodeId=" + nodeId + ", topVer=" + tx.topologyVersion() + ", dhtVer=" + dhtVer + ", nearVer=" + nearVer + "GridNearOptimisticTxPrepareFuture waiting for remote node response [" + "nodeId=" + nodeId + ", topVer=" + tx.topologyVersion() + ", dhtVer=" + dhtVer + ", nearVer=" + nearVer + "GridNearOptimisticTxPrepareFuture waiting for local keys lock [" + "node=" + cctx.localNodeId() + ", topVer=" + tx.topologyVersion() + ", allKeysAdded=" + keyFut.allKeysAdded + ", keys=" + keyFut.lockKeys + ']');
/** {@inheritDoc} */ @Override protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey key) { if (cacheCtx.isColocated()) { IgniteTxEntry txEntry = entry(key); if (txEntry == null) return cacheCtx.colocated().entryExx(key.key(), topologyVersion(), true); GridCacheEntryEx cached = txEntry.cached(); assert cached != null; if (cached.detached()) return cached; if (cached.obsoleteVersion() != null) { cached = cacheCtx.colocated().entryExx(key.key(), topologyVersion(), true); txEntry.cached(cached); } return cached; } else return cacheCtx.cache().entryEx(key.key()); }
tx.onRemap(topVer); else tx.topologyVersion(topVer);
tx.topologyVersion(), tx, timeout,
futureId(), miniId, tx.topologyVersion(), tx.xidVersion(), tx.commitVersion(),
txEntry.cached(txEntry.context().cache().entryEx(txEntry.key(), topologyVersion()));
entry = ctx.cache().entryEx(entry.key(), tx.topologyVersion());
GridNearTxPrepareRequest req = new GridNearTxPrepareRequest( futId, tx.topologyVersion(), tx, timeout,
tx.topologyVersion(topVer);
write.clearEntryReadVersion(); AffinityTopologyVersion topVer = tx.topologyVersion();
tx.topologyVersion(topVer);