[ 
https://issues.apache.org/jira/browse/IGNITE-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15295725#comment-15295725
 ] 

Andrey Gura commented on IGNITE-2969:
-------------------------------------

One more problem found. In cases when some transaction wasn't timed out during 
prepare stage system discovers timeout during finishing and exception throws:

{noformat}
[20:40:47,872][ERROR][sys-#1229%transactions.TxOptimisticDeadlockDetectionTest3%][GridNearTxLocal]
 Failed to commit transaction: GridDhtTxLocal 
[nearNodeId=6d640bd9-19c9-4fc2-b3fc-ae84e8000005, 
nearFutId=66b7989d451-ee1a655e-73f8-4db0-a2f5-6f3d7221dad8, 
nearMiniId=8db7989d451-ee1a655e-73f8-4db0-a2f5-6f3d7221dad8, 
nearFinFutId=e6b7989d451-ee1a655e-73f8-4db0-a2f5-6f3d7221dad8, 
nearFinMiniId=efb7989d451-ee1a655e-73f8-4db0-a2f5-6f3d7221dad8, 
nearXidVer=GridCacheVersion [topVer=75418777, nodeOrderDrId=6, 
globalTime=1463938847069, order=1463938774976], super=GridDhtTxLocalAdapter 
[nearOnOriginatingNode=false, nearNodes=[], 
dhtNodes=[1ba1738d-6bc1-4581-9c70-c3a823f00000], explicitLock=false, 
super=IgniteTxLocalAdapter [completedBase=null, sndTransformedVals=false, 
depEnabled=true, txState=IgniteTxStateImpl [activeCacheIds=GridLongList [idx=1, 
arr=[94416770]], txMap={IgniteTxKey [key=KeyCacheObjectImpl [val=317, 
hasValBytes=true], cacheId=94416770]=IgniteTxEntry [key=KeyCacheObjectImpl 
[val=317, hasValBytes=true], cacheId=94416770, txKey=IgniteTxKey 
[key=KeyCacheObjectImpl [val=317, hasValBytes=true], cacheId=94416770], 
val=[op=CREATE, val=CacheObjectImpl [val=2, hasValBytes=true]], 
prevVal=[op=NOOP, val=null], entryProcessorsCol=null, ttl=-1, 
conflictExpireTime=-1, conflictVer=null, explicitVer=null, dhtVer=null, 
filters=[], filtersPassed=false, filtersSet=false, 
entry=GridDhtColocatedCacheEntry [super=GridDhtCacheEntry [rdrs=[], 
locPart=GridDhtLocalPartition [id=317, mapPubSize=1, 
rmvQueue=GridCircularBuffer [sizeMask=31, idxGen=0], cntr=0, state=OWNING, 
reservations=0, empty=false, createTime=05/22/2016 20:40:46, mapPubSize=1], 
super=GridDistributedCacheEntry [super=GridCacheMapEntry 
[key=KeyCacheObjectImpl [val=317, hasValBytes=true], val=null, 
startVer=1463938775005, ver=GridCacheVersion [topVer=75418777, nodeOrderDrId=4, 
globalTime=1463938847857, order=1463938775005], hash=1633955401, 
extras=GridCacheMvccEntryExtras [mvcc=GridCacheMvcc 
[locs=[GridCacheMvccCandidate [nodeId=906a9b13-3558-4b6f-9bed-73346e100003, 
ver=GridCacheVersion [topVer=75418777, nodeOrderDrId=4, 
globalTime=1463938847857, order=1463938775004], timeout=13, ts=1463938847850, 
threadId=2753, id=4202, topVer=AffinityTopologyVersion [topVer=8, 
minorTopVer=39], reentry=null, 
otherNodeId=6d640bd9-19c9-4fc2-b3fc-ae84e8000005, otherVer=GridCacheVersion 
[topVer=75418777, nodeOrderDrId=6, globalTime=1463938847069, 
order=1463938774976], mappedDhtNodes=null, mappedNearNodes=null, ownerVer=null, 
serOrder=null, key=KeyCacheObjectImpl [val=317, hasValBytes=true], 
masks=local=1|owner=1|ready=1|reentry=0|used=0|tx=1|single_implicit=0|dht_local=1|near_local=0|removed=0,
 prevVer=null, nextVer=null]], rmts=null]], flags=0]]]], prepared=true, 
locked=false, nodeId=null, locMapped=false, expiryPlc=null, 
transferExpiryPlc=false, flags=0, partUpdateCntr=0, serReadVer=null, 
xidVer=null], IgniteTxKey [key=KeyCacheObjectImpl [val=319, hasValBytes=true], 
cacheId=94416770]=IgniteTxEntry [key=KeyCacheObjectImpl [val=319, 
hasValBytes=true], cacheId=94416770, txKey=IgniteTxKey [key=KeyCacheObjectImpl 
[val=319, hasValBytes=true], cacheId=94416770], val=[op=CREATE, 
val=CacheObjectImpl [val=2, hasValBytes=true]], prevVal=[op=NOOP, val=null], 
entryProcessorsCol=null, ttl=-1, conflictExpireTime=-1, conflictVer=null, 
explicitVer=null, dhtVer=null, filters=[], filtersPassed=false, 
filtersSet=false, entry=GridDhtColocatedCacheEntry [super=GridDhtCacheEntry 
[rdrs=[], locPart=GridDhtLocalPartition [id=319, mapPubSize=1, 
rmvQueue=GridCircularBuffer [sizeMask=31, idxGen=0], cntr=0, state=OWNING, 
reservations=0, empty=false, createTime=05/22/2016 20:40:46, mapPubSize=1], 
super=GridDistributedCacheEntry [super=GridCacheMapEntry 
[key=KeyCacheObjectImpl [val=319, hasValBytes=true], val=null, 
startVer=1463938775007, ver=GridCacheVersion [topVer=75418777, nodeOrderDrId=4, 
globalTime=1463938847863, order=1463938775007], hash=802152124, 
extras=GridCacheMvccEntryExtras [mvcc=GridCacheMvcc 
[locs=[GridCacheMvccCandidate [nodeId=906a9b13-3558-4b6f-9bed-73346e100003, 
ver=GridCacheVersion [topVer=75418777, nodeOrderDrId=4, 
globalTime=1463938847857, order=1463938775004], timeout=3, ts=1463938847860, 
threadId=2753, id=4207, topVer=AffinityTopologyVersion [topVer=8, 
minorTopVer=39], reentry=null, 
otherNodeId=6d640bd9-19c9-4fc2-b3fc-ae84e8000005, otherVer=GridCacheVersion 
[topVer=75418777, nodeOrderDrId=6, globalTime=1463938847069, 
order=1463938774976], mappedDhtNodes=null, mappedNearNodes=null, ownerVer=null, 
serOrder=null, key=KeyCacheObjectImpl [val=319, hasValBytes=true], 
masks=local=1|owner=1|ready=1|reentry=0|used=0|tx=1|single_implicit=0|dht_local=1|near_local=0|removed=0,
 prevVer=null, nextVer=null]], rmts=null]], flags=0]]]], prepared=true, 
locked=false, nodeId=null, locMapped=false, expiryPlc=null, 
transferExpiryPlc=false, flags=0, partUpdateCntr=0, serReadVer=null, 
xidVer=null]}], super=IgniteTxAdapter [xidVer=GridCacheVersion 
[topVer=75418777, nodeOrderDrId=4, globalTime=1463938847857, 
order=1463938775004], writeVer=GridCacheVersion [topVer=75418777, 
nodeOrderDrId=4, globalTime=1463938847863, order=1463938775008], 
implicit=false, loc=true, threadId=2753, startTime=1463938847850, 
nodeId=906a9b13-3558-4b6f-9bed-73346e100003, startVer=GridCacheVersion 
[topVer=75418777, nodeOrderDrId=4, globalTime=1463938847857, 
order=1463938775004], endVer=null, isolation=REPEATABLE_READ, 
concurrency=OPTIMISTIC, timeout=13, sysInvalidate=false, sys=false, plc=2, 
commitVer=null, finalizing=USER_FINISH, preparing=false, invalidParts=null, 
state=MARKED_ROLLBACK, timedOut=false, topVer=AffinityTopologyVersion 
[topVer=8, minorTopVer=39], duration=20ms, onePhaseCommit=false], size=2]]]
class org.apache.ignite.internal.transactions.IgniteTxTimeoutCheckedException: 
Cache transaction timed out (was rolled back automatically): GridDhtTxLocal 
[nearNodeId=6d640bd9-19c9-4fc2-b3fc-ae84e8000005, 
nearFutId=66b7989d451-ee1a655e-73f8-4db0-a2f5-6f3d7221dad8, 
nearMiniId=8db7989d451-ee1a655e-73f8-4db0-a2f5-6f3d7221dad8, 
nearFinFutId=e6b7989d451-ee1a655e-73f8-4db0-a2f5-6f3d7221dad8, 
nearFinMiniId=efb7989d451-ee1a655e-73f8-4db0-a2f5-6f3d7221dad8, 
nearXidVer=GridCacheVersion [topVer=75418777, nodeOrderDrId=6, 
globalTime=1463938847069, order=1463938774976], super=GridDhtTxLocalAdapter 
[nearOnOriginatingNode=false, nearNodes=[], 
dhtNodes=[1ba1738d-6bc1-4581-9c70-c3a823f00000], explicitLock=false, 
super=IgniteTxLocalAdapter [completedBase=null, sndTransformedVals=false, 
depEnabled=true, txState=IgniteTxStateImpl [activeCacheIds=GridLongList [idx=1, 
arr=[94416770]], txMap={IgniteTxKey [key=KeyCacheObjectImpl [val=317, 
hasValBytes=true], cacheId=94416770]=IgniteTxEntry [key=KeyCacheObjectImpl 
[val=317, hasValBytes=true], cacheId=94416770, txKey=IgniteTxKey 
[key=KeyCacheObjectImpl [val=317, hasValBytes=true], cacheId=94416770], 
val=[op=CREATE, val=CacheObjectImpl [val=2, hasValBytes=true]], 
prevVal=[op=NOOP, val=null], entryProcessorsCol=null, ttl=-1, 
conflictExpireTime=-1, conflictVer=null, explicitVer=null, dhtVer=null, 
filters=[], filtersPassed=false, filtersSet=false, 
entry=GridDhtColocatedCacheEntry [super=GridDhtCacheEntry [rdrs=[], 
locPart=GridDhtLocalPartition [id=317, mapPubSize=1, 
rmvQueue=GridCircularBuffer [sizeMask=31, idxGen=0], cntr=0, state=OWNING, 
reservations=0, empty=false, createTime=05/22/2016 20:40:46, mapPubSize=1], 
super=GridDistributedCacheEntry [super=GridCacheMapEntry 
[key=KeyCacheObjectImpl [val=317, hasValBytes=true], val=null, 
startVer=1463938775005, ver=GridCacheVersion [topVer=75418777, nodeOrderDrId=4, 
globalTime=1463938847857, order=1463938775005], hash=1633955401, 
extras=GridCacheMvccEntryExtras [mvcc=GridCacheMvcc 
[locs=[GridCacheMvccCandidate [nodeId=906a9b13-3558-4b6f-9bed-73346e100003, 
ver=GridCacheVersion [topVer=75418777, nodeOrderDrId=4, 
globalTime=1463938847857, order=1463938775004], timeout=13, ts=1463938847850, 
threadId=2753, id=4202, topVer=AffinityTopologyVersion [topVer=8, 
minorTopVer=39], reentry=null, 
otherNodeId=6d640bd9-19c9-4fc2-b3fc-ae84e8000005, otherVer=GridCacheVersion 
[topVer=75418777, nodeOrderDrId=6, globalTime=1463938847069, 
order=1463938774976], mappedDhtNodes=null, mappedNearNodes=null, ownerVer=null, 
serOrder=null, key=KeyCacheObjectImpl [val=317, hasValBytes=true], 
masks=local=1|owner=1|ready=1|reentry=0|used=0|tx=1|single_implicit=0|dht_local=1|near_local=0|removed=0,
 prevVer=null, nextVer=null]], rmts=null]], flags=0]]]], prepared=true, 
locked=false, nodeId=null, locMapped=false, expiryPlc=null, 
transferExpiryPlc=false, flags=0, partUpdateCntr=0, serReadVer=null, 
xidVer=null], IgniteTxKey [key=KeyCacheObjectImpl [val=319, hasValBytes=true], 
cacheId=94416770]=IgniteTxEntry [key=KeyCacheObjectImpl [val=319, 
hasValBytes=true], cacheId=94416770, txKey=IgniteTxKey [key=KeyCacheObjectImpl 
[val=319, hasValBytes=true], cacheId=94416770], val=[op=CREATE, 
val=CacheObjectImpl [val=2, hasValBytes=true]], prevVal=[op=NOOP, val=null], 
entryProcessorsCol=null, ttl=-1, conflictExpireTime=-1, conflictVer=null, 
explicitVer=null, dhtVer=null, filters=[], filtersPassed=false, 
filtersSet=false, entry=GridDhtColocatedCacheEntry [super=GridDhtCacheEntry 
[rdrs=[], locPart=GridDhtLocalPartition [id=319, mapPubSize=1, 
rmvQueue=GridCircularBuffer [sizeMask=31, idxGen=0], cntr=0, state=OWNING, 
reservations=0, empty=false, createTime=05/22/2016 20:40:46, mapPubSize=1], 
super=GridDistributedCacheEntry [super=GridCacheMapEntry 
[key=KeyCacheObjectImpl [val=319, hasValBytes=true], val=null, 
startVer=1463938775007, ver=GridCacheVersion [topVer=75418777, nodeOrderDrId=4, 
globalTime=1463938847863, order=1463938775007], hash=802152124, 
extras=GridCacheMvccEntryExtras [mvcc=GridCacheMvcc 
[locs=[GridCacheMvccCandidate [nodeId=906a9b13-3558-4b6f-9bed-73346e100003, 
ver=GridCacheVersion [topVer=75418777, nodeOrderDrId=4, 
globalTime=1463938847857, order=1463938775004], timeout=3, ts=1463938847860, 
threadId=2753, id=4207, topVer=AffinityTopologyVersion [topVer=8, 
minorTopVer=39], reentry=null, 
otherNodeId=6d640bd9-19c9-4fc2-b3fc-ae84e8000005, otherVer=GridCacheVersion 
[topVer=75418777, nodeOrderDrId=6, globalTime=1463938847069, 
order=1463938774976], mappedDhtNodes=null, mappedNearNodes=null, ownerVer=null, 
serOrder=null, key=KeyCacheObjectImpl [val=319, hasValBytes=true], 
masks=local=1|owner=1|ready=1|reentry=0|used=0|tx=1|single_implicit=0|dht_local=1|near_local=0|removed=0,
 prevVer=null, nextVer=null]], rmts=null]], flags=0]]]], prepared=true, 
locked=false, nodeId=null, locMapped=false, expiryPlc=null, 
transferExpiryPlc=false, flags=0, partUpdateCntr=0, serReadVer=null, 
xidVer=null]}], super=IgniteTxAdapter [xidVer=GridCacheVersion 
[topVer=75418777, nodeOrderDrId=4, globalTime=1463938847857, 
order=1463938775004], writeVer=GridCacheVersion [topVer=75418777, 
nodeOrderDrId=4, globalTime=1463938847863, order=1463938775008], 
implicit=false, loc=true, threadId=2753, startTime=1463938847850, 
nodeId=906a9b13-3558-4b6f-9bed-73346e100003, startVer=GridCacheVersion 
[topVer=75418777, nodeOrderDrId=4, globalTime=1463938847857, 
order=1463938775004], endVer=null, isolation=REPEATABLE_READ, 
concurrency=OPTIMISTIC, timeout=13, sysInvalidate=false, sys=false, plc=2, 
commitVer=null, finalizing=USER_FINISH, preparing=false, invalidParts=null, 
state=MARKED_ROLLBACK, timedOut=false, topVer=AffinityTopologyVersion 
[topVer=8, minorTopVer=39], duration=20ms, onePhaseCommit=false], size=2]]]
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter.checkValid(IgniteTxLocalAdapter.java:3512)
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter.userCommit(IgniteTxLocalAdapter.java:644)
        at 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocalAdapter.finish(GridDhtTxLocalAdapter.java:775)
        at 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocal.finish(GridDhtTxLocal.java:662)
        at 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocal.commitAsync(GridDhtTxLocal.java:562)
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.finishDhtLocal(IgniteTxHandler.java:779)
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.finish(IgniteTxHandler.java:682)
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.processNearTxFinishRequest(IgniteTxHandler.java:617)
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$3.apply(IgniteTxHandler.java:128)
        at 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$3.apply(IgniteTxHandler.java:126)
        at 
org.apache.ignite.internal.processors.cache.GridCacheIoManager.processMessage(GridCacheIoManager.java:582)
        at 
org.apache.ignite.internal.processors.cache.GridCacheIoManager.onMessage0(GridCacheIoManager.java:280)
        at 
org.apache.ignite.internal.processors.cache.GridCacheIoManager.handleMessage(GridCacheIoManager.java:204)
        at 
org.apache.ignite.internal.processors.cache.GridCacheIoManager.access$000(GridCacheIoManager.java:80)
        at 
org.apache.ignite.internal.processors.cache.GridCacheIoManager$1.onMessage(GridCacheIoManager.java:163)
        at 
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1058)
        at 
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:836)
        at 
org.apache.ignite.internal.managers.communication.GridIoManager.access$1700(GridIoManager.java:104)
        at 
org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:799)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
{noformat}

In this case transaction does not finish correctly. For now I see only one idea 
how to fix it but I'm not sure that it is correct solution.
If {{checkValid}} method throws {{IgniteTxTimeoutCheckedException}} then we 
should just mark transaction for rollback only and then transaction will be 
invalidated. Is it correct?

> Optimistic transactions support in deadlock detection
> -----------------------------------------------------
>
>                 Key: IGNITE-2969
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2969
>             Project: Ignite
>          Issue Type: Improvement
>          Components: cache
>            Reporter: Andrey Gura
>            Assignee: Andrey Gura
>             Fix For: 1.7
>
>
> Deadlock detection doesn't support optimistic transactions now. It should be 
> implemented.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to