use of org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryFuture in project ignite by apache.
the class IgniteTxHandler method processCheckPreparedTxResponse.
/**
* @param nodeId Node ID.
* @param res Response.
*/
protected void processCheckPreparedTxResponse(UUID nodeId, GridCacheTxRecoveryResponse res) {
if (txRecoveryMsgLog.isDebugEnabled()) {
txRecoveryMsgLog.debug("Received tx recovery response [txId=" + res.version() + ", node=" + nodeId + ", res=" + res + ']');
}
GridCacheTxRecoveryFuture fut = (GridCacheTxRecoveryFuture) ctx.mvcc().future(res.futureId());
if (fut == null) {
if (txRecoveryMsgLog.isDebugEnabled()) {
txRecoveryMsgLog.debug("Failed to find future for tx recovery response [txId=" + res.version() + ", node=" + nodeId + ", res=" + res + ']');
}
return;
} else
res.txState(fut.tx().txState());
fut.onResult(nodeId, res);
}
use of org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryFuture in project ignite by apache.
the class IgniteTxManager method commitIfPrepared.
/**
* Commits transaction in case when node started transaction failed, but all related
* transactions were prepared (invalidates transaction if it is not fully prepared).
*
* @param tx Transaction.
* @param failedNodeIds Failed nodes IDs.
*/
public void commitIfPrepared(IgniteInternalTx tx, Set<UUID> failedNodeIds) {
assert tx instanceof GridDhtTxLocal || tx instanceof GridDhtTxRemote : tx;
assert !F.isEmpty(tx.transactionNodes()) : tx;
assert tx.nearXidVersion() != null : tx;
GridCacheTxRecoveryFuture fut = new GridCacheTxRecoveryFuture(cctx, tx, failedNodeIds, tx.transactionNodes());
cctx.mvcc().addFuture(fut, fut.futureId());
if (log.isDebugEnabled())
log.debug("Checking optimistic transaction state on remote nodes [tx=" + tx + ", fut=" + fut + ']');
fut.prepare();
}
Aggregations