use of org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter in project ignite by apache.
the class DeadlockDetectionManager method startComputation.
/**
* Starts a deadlock detection for a given pair of transaction versions (wait-for edge).
*
* @param waiterVer Version of the waiting transaction.
* @param blockerVer Version of the waited for transaction.
*/
private void startComputation(MvccVersion waiterVer, MvccVersion blockerVer) {
if (log.isDebugEnabled())
log.debug("Starting deadlock detection [waiterVer=" + waiterVer + ", blockerVer=" + blockerVer + ']');
Optional<GridDhtTxLocalAdapter> waitingTx = findTx(waiterVer);
Optional<GridDhtTxLocalAdapter> blockerTx = findTx(blockerVer);
if (waitingTx.isPresent() && blockerTx.isPresent()) {
GridDhtTxLocalAdapter wTx = waitingTx.get();
GridDhtTxLocalAdapter bTx = blockerTx.get();
sendProbe(bTx.eventNodeId(), wTx.xidVersion(), // real start time will be filled later when corresponding near node is visited
singleton(new ProbedTx(wTx.nodeId(), wTx.xidVersion(), wTx.nearXidVersion(), -1, wTx.lockCounter())), new ProbedTx(bTx.nodeId(), bTx.xidVersion(), bTx.nearXidVersion(), -1, bTx.lockCounter()), true);
}
}
Aggregations