/** {@inheritDoc} */ @Override public int partition() { return U.safeAbs(version().hashCode()); }
/** * @param cacheMsg Cache message. * @return Transaction ID if applicable for message. */ @Nullable private GridCacheVersion txId(GridCacheMessage cacheMsg) { if (cacheMsg instanceof GridDhtTxPrepareRequest) return ((GridDhtTxPrepareRequest)cacheMsg).nearXidVersion(); else if (cacheMsg instanceof GridNearTxPrepareRequest) return ((GridNearTxPrepareRequest)cacheMsg).version(); else if (cacheMsg instanceof GridNearTxPrepareResponse) return ((GridNearTxPrepareResponse)cacheMsg).version(); else if (cacheMsg instanceof GridNearTxFinishRequest) return ((GridNearTxFinishRequest)cacheMsg).version(); else if (cacheMsg instanceof GridNearTxFinishResponse) return ((GridNearTxFinishResponse)cacheMsg).xid(); return null; }
/** * @param nearNodeId Sender node ID. * @param req Request. */ private void processNearTxPrepareRequest(UUID nearNodeId, GridNearTxPrepareRequest req) { if (txPrepareMsgLog.isDebugEnabled()) { txPrepareMsgLog.debug("Received near prepare request [txId=" + req.version() + ", node=" + nearNodeId + ']'); } ClusterNode nearNode = ctx.node(nearNodeId); if (nearNode == null) { if (txPrepareMsgLog.isDebugEnabled()) { txPrepareMsgLog.debug("Received near prepare from node that left grid (will ignore) [" + "txId=" + req.version() + ", node=" + nearNodeId + ']'); } return; } processNearTxPrepareRequest0(nearNode, req); }
if (e == null) e = new IgniteTxTimeoutCheckedException("Failed to wait topology version for near prepare " + "[txId=" + req.version() + ", topVer=" + topFut.initialVersion() + ", node=" + node.id() + req.version(), req.futureId(), req.miniId(), req.version(), req.version(), null, e, "[txId=" + req.version() + ", topVer=" + topFut.initialVersion() + ", node=" + node.id() +
@Override public GridNearTxPrepareResponse apply(IgniteInternalFuture<GridNearTxPrepareResponse> f) { try { return f.get(); } catch (Exception e) { locTx.setRollbackOnly(); // Just in case. if (!X.hasCause(e, IgniteTxOptimisticCheckedException.class) && !X.hasCause(e, IgniteFutureCancelledException.class)) U.error(log, "Failed to prepare DHT transaction: " + locTx, e); return new GridNearTxPrepareResponse( req.partition(), req.version(), req.futureId(), req.miniId(), req.version(), req.version(), null, e, null, req.onePhaseCommit(), req.deployInfo() != null); } } });
/** * @param nearNode Sender node. * @param req Request. */ private void processNearTxPrepareRequest0(ClusterNode nearNode, GridNearTxPrepareRequest req) { IgniteInternalFuture<GridNearTxPrepareResponse> fut; if (req.firstClientRequest() && req.allowWaitTopologyFuture()) { for (;;) { if (waitForExchangeFuture(nearNode, req)) return; fut = prepareNearTx(nearNode, req); if (fut != null) break; } } else fut = prepareNearTx(nearNode, req); assert req.txState() != null || fut == null || fut.error() != null || (ctx.tm().tx(req.version()) == null && ctx.tm().nearTx(req.version()) == null); }
final GridNearTxPrepareRequest req = (GridNearTxPrepareRequest)msg0; GridCacheVersion txId = req.version();
GridCacheVersion mappedVer = ctx.tm().mappedVersion(req.version()); U.warn(log, "Missing local transaction for mapped near version [nearVer=" + req.version() + ", mappedVer=" + mappedVer + ']'); else { "txId=" + req.version() + ", node=" + nearNode.id() + ", reqTopVer=" + req.topologyVersion() + "txId=" + req.version() + ", node=" + nearNode.id() + ", reqTopVer=" + req.topologyVersion() + GridNearTxPrepareResponse res = new GridNearTxPrepareResponse( req.partition(), req.version(), req.futureId(), req.miniId(), req.version(), req.version(), null, null, txPrepareMsgLog.debug("Sent remap response for near prepare [txId=" + req.version() + ", node=" + nearNode.id() + ']'); if (txPrepareMsgLog.isDebugEnabled()) { txPrepareMsgLog.debug("Failed to send remap response for near prepare, node failed [" +
/** {@inheritDoc} */ @Override public int partition() { return U.safeAbs(version().hashCode()); }
/** * @param cacheMsg Cache message. * @return Transaction ID if applicable for message. */ @Nullable private GridCacheVersion txId(GridCacheMessage cacheMsg) { if (cacheMsg instanceof GridDhtTxPrepareRequest) return ((GridDhtTxPrepareRequest)cacheMsg).nearXidVersion(); else if (cacheMsg instanceof GridNearTxPrepareRequest) return ((GridNearTxPrepareRequest)cacheMsg).version(); else if (cacheMsg instanceof GridNearTxPrepareResponse) return ((GridNearTxPrepareResponse)cacheMsg).version(); else if (cacheMsg instanceof GridNearTxFinishRequest) return ((GridNearTxFinishRequest)cacheMsg).version(); else if (cacheMsg instanceof GridNearTxFinishResponse) return ((GridNearTxFinishResponse)cacheMsg).xid(); return null; }
/** * @param nearNodeId Sender node ID. * @param req Request. */ private void processNearTxPrepareRequest(UUID nearNodeId, GridNearTxPrepareRequest req) { if (txPrepareMsgLog.isDebugEnabled()) { txPrepareMsgLog.debug("Received near prepare request [txId=" + req.version() + ", node=" + nearNodeId + ']'); } ClusterNode nearNode = ctx.node(nearNodeId); if (nearNode == null) { if (txPrepareMsgLog.isDebugEnabled()) { txPrepareMsgLog.debug("Received near prepare from node that left grid (will ignore) [" + "txId=" + req.version() + ", node=" + nearNodeId + ']'); } return; } processNearTxPrepareRequest0(nearNode, req); }
if (e == null) e = new IgniteTxTimeoutCheckedException("Failed to wait topology version for near prepare " + "[txId=" + req.version() + ", topVer=" + topFut.initialVersion() + ", node=" + node.id() + req.version(), req.futureId(), req.miniId(), req.version(), req.version(), null, e, "[txId=" + req.version() + ", topVer=" + topFut.initialVersion() + ", node=" + node.id() +
@Override public GridNearTxPrepareResponse apply(IgniteInternalFuture<GridNearTxPrepareResponse> f) { try { return f.get(); } catch (Exception e) { locTx.setRollbackOnly(); // Just in case. if (!X.hasCause(e, IgniteTxOptimisticCheckedException.class) && !X.hasCause(e, IgniteFutureCancelledException.class)) U.error(log, "Failed to prepare DHT transaction: " + locTx, e); return new GridNearTxPrepareResponse( req.partition(), req.version(), req.futureId(), req.miniId(), req.version(), req.version(), null, e, null, req.onePhaseCommit(), req.deployInfo() != null); } } });
/** * @param nearNode Sender node. * @param req Request. */ private void processNearTxPrepareRequest0(ClusterNode nearNode, GridNearTxPrepareRequest req) { IgniteInternalFuture<GridNearTxPrepareResponse> fut; if (req.firstClientRequest() && req.allowWaitTopologyFuture()) { for (;;) { if (waitForExchangeFuture(nearNode, req)) return; fut = prepareNearTx(nearNode, req); if (fut != null) break; } } else fut = prepareNearTx(nearNode, req); assert req.txState() != null || fut == null || fut.error() != null || (ctx.tm().tx(req.version()) == null && ctx.tm().nearTx(req.version()) == null); }
GridCacheVersion mappedVer = ctx.tm().mappedVersion(req.version()); U.warn(log, "Missing local transaction for mapped near version [nearVer=" + req.version() + ", mappedVer=" + mappedVer + ']'); else { "txId=" + req.version() + ", node=" + nearNode.id() + ", reqTopVer=" + req.topologyVersion() + "txId=" + req.version() + ", node=" + nearNode.id() + ", reqTopVer=" + req.topologyVersion() + GridNearTxPrepareResponse res = new GridNearTxPrepareResponse( req.partition(), req.version(), req.futureId(), req.miniId(), req.version(), req.version(), null, null, txPrepareMsgLog.debug("Sent remap response for near prepare [txId=" + req.version() + ", node=" + nearNode.id() + ']'); if (txPrepareMsgLog.isDebugEnabled()) { txPrepareMsgLog.debug("Failed to send remap response for near prepare, node failed [" +