[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-08-29 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Fixed as part of IGNITE-2968.

> 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.8
>
>
> Deadlock detection doesn't support optimistic transactions now. It should be 
> implemented.



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


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-08-29 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Fixed as part of IGNITE-2968.

> 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.8
>
>
> Deadlock detection doesn't support optimistic transactions now. It should be 
> implemented.



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


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-07-12 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Also added fix for {{GridDhtLockFuture}} that affect pessimistic transactions 
with node restarts and deadlock detection disabled.

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-07-06 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Race found in {{IgniteTxManager.txLockInfo}} method. When methods creates 
{{TxLock}} instances based on local {{GridCacheMvccCandidate}}'s it is possible 
to find more than one owner {{GridCacheMvccCandidate}} because it can be 
changed during iteration. It leads to {{AssertionError}} in 
{{TxDeadlockFuture.updateWaitForGraph}} method. As simple solution I just treat 
all owners (except first) as candidates. But should exist more accurate 
solution.

At this moment {{TxDeadlockDetectionNoHangsTest.testNoHangsOptimistic}} test 
fails periodically with {{AssertionError}}. Need investigate:

{noformat}
java.lang.AssertionError: Transaction does not own lock for update 
[entry=GridDhtColocatedCacheEntry [super=GridDhtCacheEntry [rdrs=[], 
locPart=GridDhtLocalPartition [id=36, mapPubSize=1, rmvQueue=GridCircularBuffer 
[sizeMask=31, idxGen=0], cntr=0, state=OWNING, reservations=0, empty=false, 
createTime=07/06/2016 20:25:20, mapPubSize=1], super=GridDistributedCacheEntry 
[super=GridCacheMapEntry [key=KeyCacheObjectImpl [val=36, hasValBytes=true], 
val=null, startVer=1467825951227, ver=GridCacheVersion [topVer=79305930, 
nodeOrderDrId=3, globalTime=1467825954832, order=1467825951227], 
hash=-1934024054, extras=GridCacheMvccEntryExtras [mvcc=GridCacheMvcc 
[locs=[GridCacheMvccCandidate [nodeId=fe033852-4308-417a-b726-c517bdb2, 
ver=GridCacheVersion [topVer=79305930, nodeOrderDrId=3, 
globalTime=1467825954831, order=1467825951226], timeout=500, ts=1467825954823, 
threadId=49974, id=96645, topVer=AffinityTopologyVersion [topVer=13, 
minorTopVer=0], reentry=null, otherNodeId=fe033852-4308-417a-b726-c517bdb2, 
otherVer=GridCacheVersion [topVer=79305930, nodeOrderDrId=3, 
globalTime=1467825954831, order=1467825951226], mappedDhtNodes=null, 
mappedNearNodes=null, ownerVer=null, serOrder=null, key=KeyCacheObjectImpl 
[val=36, 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, tx=GridNearTxLocal 
[mappings=IgniteTxMappingsImpl [], nearLocallyMapped=false, 
colocatedLocallyMapped=true, needCheckBackup=null, hasRemoteLocks=false, 
mappings=IgniteTxMappingsImpl [], super=GridDhtTxLocalAdapter 
[nearOnOriginatingNode=false, nearNodes=[], dhtNodes=[], explicitLock=false, 
super=IgniteTxLocalAdapter [completedBase=null, sndTransformedVals=false, 
depEnabled=true, txState=IgniteTxStateImpl [activeCacheIds=GridLongList [idx=1, 
arr=[94416770]], txMap={IgniteTxKey [key=KeyCacheObjectImpl [val=14, 
hasValBytes=true], cacheId=94416770]=IgniteTxEntry [key=KeyCacheObjectImpl 
[val=14, hasValBytes=true], cacheId=94416770, txKey=IgniteTxKey 
[key=KeyCacheObjectImpl [val=14, hasValBytes=true], cacheId=94416770], 
val=[op=UPDATE, val=UserCacheObjectImpl [val=0, hasValBytes=true]], 
prevVal=[op=UPDATE, val=UserCacheObjectImpl [val=0, hasValBytes=true]], 
entryProcessorsCol=null, ttl=-1, conflictExpireTime=-1, conflictVer=null, 
explicitVer=null, dhtVer=GridCacheVersion [topVer=79305930, nodeOrderDrId=2, 
globalTime=1467825955336, order=1467825951423], filters=[], 
filtersPassed=false, filtersSet=true, entry=GridDhtDetachedCacheEntry 
[super=GridDistributedCacheEntry [super=GridCacheMapEntry 
[key=KeyCacheObjectImpl [val=14, hasValBytes=true], val=null, 
startVer=1467825951345, ver=GridCacheVersion [topVer=79305930, nodeOrderDrId=3, 
globalTime=1467825954833, order=1467825951345], hash=14, extras=null, 
flags=0]]], prepared=false, locked=false, 
nodeId=584b2f41-c474-4fe7-88c7-6dcbbc70, locMapped=false, expiryPlc=null, 
transferExpiryPlc=false, flags=0, partUpdateCntr=0, serReadVer=null, 
xidVer=GridCacheVersion [topVer=79305930, nodeOrderDrId=3, 
globalTime=1467825954833, order=1467825951311]], IgniteTxKey 
[key=KeyCacheObjectImpl [val=37, hasValBytes=true], 
cacheId=94416770]=IgniteTxEntry [key=KeyCacheObjectImpl [val=37, 
hasValBytes=true], cacheId=94416770, txKey=IgniteTxKey [key=KeyCacheObjectImpl 
[val=37, hasValBytes=true], cacheId=94416770], val=[op=UPDATE, 
val=UserCacheObjectImpl [val=0, hasValBytes=false]], prevVal=[op=UPDATE, 
val=UserCacheObjectImpl [val=0, hasValBytes=false]], entryProcessorsCol=null, 
ttl=-1, conflictExpireTime=-1, conflictVer=null, explicitVer=null, dhtVer=null, 
filters=[], filtersPassed=false, filtersSet=true, 
entry=GridDhtDetachedCacheEntry [super=GridDistributedCacheEntry 
[super=GridCacheMapEntry [key=KeyCacheObjectImpl [val=37, hasValBytes=true], 
val=null, startVer=1467825951346, ver=GridCacheVersion [topVer=79305930, 
nodeOrderDrId=3, globalTime=1467825954833, order=1467825951346], hash=37, 
extras=null, flags=0]]], prepared=false, locked=false, 
nodeId=f98ebdda-7833-4e5d-bfdd-2f6ad8c1, locMapped=false, expiryPlc=null, 

[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-07-05 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Found bug in {{TxDeadlockDetection.findCycle}} method that sometimes lead to 
{{NullPointerException}}. Fixed.

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-17 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

{{GridDhtTxPrepareFuture}} also changed accordingly to review comments.

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-16 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Items 1-3, 5-7 are fixed.

{{TxPessimisticDeadlockDetectionCrossCacheTest}} exists already (item 8).

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-15 Thread Semen Boikov (JIRA)

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

Semen Boikov commented on IGNITE-2969:
--

Reviewed, my comments:
- need change GridNearOptimisticTxPrepareFuture.requestedKeys to do not convert 
IgniteTxKey into KeyCacheObject (also fix this for 
GridDhtColocatedLockFuture.requestedKeys)
- need add synhronization for 'futs' access in 
GridNearOptimisticTxPrepareFuture.requestedKeys
- in GridNearOptimisticTxPrepareFuture you check that future timedout only at 
the moment when next MiniFuture is completed, I think this makes unnecessary 
GridNearOptimisticTxPrepareFuture.timeoutObj, just check remaining time at the 
moment when MiniFuture is completed. Also notice that currently there is a bug: 
GridNearOptimisticTxPrepareFuture:497 - you call remainingTime, but do not 
check it for '-1'.
- it is potentially dangerous that in GridDhtTxPrepareFuture too many code is 
executed inside 'sychronized' block. Please try to change it (e.g. from 
onTimeout callback clean 'lockKeys' and 'futs', thus message responses and 
onOwnerChanged callback will be ignored). Also let's avoid 
synchronzied(lockKeys) inside synchronzied(this)
- please add deadlock detection futures logging in 
GridCachePartitionExchangeManager.dumpDebugInfo
- I noticed that when I run TxDeadlockDetectionNoHangsTest then deadlock 
detection future was finished by timeout, let's increase this timeout in tests 
to detect such cases
- please add similar NoHangs test with deadlock detection disabled
- please add deadlock detection test with cross cache tx


> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-10 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Tests fixed. Please review.

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-08 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

In {{GridNearOptimisticTxPrepareFuture}} some code blocks are synchronized now. 
Цe just wanted to make sure that there is no any contention on thi synchronized 
blocks that can affect performance.

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-07 Thread Dmitriy Setrakyan (JIRA)

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

Dmitriy Setrakyan commented on IGNITE-2969:
---

Yakov, you are right, I didn't notice that some numbers got faster, but others 
slower. Looks like a standard fluctuation. 

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-07 Thread Yakov Zhdanov (JIRA)

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

Yakov Zhdanov commented on IGNITE-2969:
---

I don't see any drop here.

[~agura], [~sboikov], can you please comment on what syncronization is meant?


> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-07 Thread Dmitriy Setrakyan (JIRA)

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

Dmitriy Setrakyan commented on IGNITE-2969:
---

The performance drop does not make sense to me. If the deadlock detection kicks 
in only in case of a deadlock, how can it even possibly affect performance?

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-07 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Rerun benchmarks more accurate. Results below:

{noformat}
 With detection   
Without detection

tx-put-1-backup   19,608.72   19,854.48
tx-put-offheap-1-backup  18,480.55   17,938.68
tx-put-offheap-val-1-backup20,423.42   19,936.32
tx-put-get-1-backup 18,250.85  18,526.29
tx-put-get-offheap16,033.24  16,433.10
tx-put-get-offheap-val-1-backup  18,069.81  18,502.69
{noformat}

So I can conclude that additional synchronization doesn't affect performance.

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-07 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

I ran tests for deadlock detection with pessimistic and optimistic transactions 
and can conlude that introducing of timeouts in {{GridDhtTxPrepareFuture}} 
affects both transactions types and in some cases lead to problems with 
transaction finishing.

Also transactions related benchmarks was run in order to check how additional 
synchronization in {{GridNearOptimisticTxPrepareFuture}} will affect 
performance. There is 2-5% perfromance drop on my lap top (ignite-1.6 vs 
ignite-2969 branch).

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-06-06 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

I ran tests for deadlock detection with pessimistic and optimistic transactions 
and can conlude that introducing of timeouts in {{GridDhtTxPrepareFuture}} 
affects both transactions types and in some cases lead to problems with 
transaction finishing.

Also transactions related benchmarks was run in order to check how additional 
synchronization in {{GridNearOptimisticTxPrepareFuture}} will affect 
performance. There is 2-5% perfromance drop on my lap top (ignite-1.6 vs 
ignite-2969 branch).

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-05-31 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Nested synchronization is removed.

Transactions classes don't implement {{GridTimeoutObject}} and timeout logic is 
simplified. 

Also need check and revise all places where transactions operates with 
{{remainingTime()}} method, prepare and finish futures. 

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-05-27 Thread Semen Boikov (JIRA)

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

Semen Boikov commented on IGNITE-2969:
--

Did quick review, have some comments:
- you added additional 'sychronized' usages, need check that it does not impact 
performance, please execute some single-node benchmark. If performance is 
impacted then need to use additional synchronization only if timeout is enabled
- in some places there is nested synchronization, I think it can be changed to 
use only one mutex
- now transactions implement GridTimeoutObject and 'isTimedOut' is called in 
some random places, I think this complicates timeout handling logic and is not 
really needed. Let's remove GridTimeoutObject from tx, and all timeout handling 
logic should remain only in transaction futures (lock and prepare futures)

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-05-26 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Implemented. Waiting for TC. Also additional testing needed.

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-05-23 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

I was wrong about {{checkValid}} method behavior. Actually this checking is 
redundant for cases when transaction on finish stage with {{COMMITING}} state 
and on prepare stage with {{PREPARING}} state. I fixed this behavior and no 
more unfinished transactions during tests. Waiting for TC results.

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-05-22 Thread Andrey Gura (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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-ae84e805, 
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-c3a823f0], 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-73346e13, 
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-ae84e805, 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-73346e13, 
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-ae84e805, otherVer=GridCacheVersion 
[topVer=75418777, nodeOrderDrId=6, globalTime=1463938847069, 
order=1463938774976], mappedDhtNodes=null, mappedNearNodes=null, ownerVer=null, 
serOrder=null, 

[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-05-18 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

[~sboikov], I see only one reliable way to provide proper synchronization. 
Because {{GridNearOptimisticTxPrepareFuture}} sends all 
{{GridNearTxPrepareRequest}} sequentially and always awaits response before 
sending next request we can use this property.

Main synchronization point is 
{{GridNearOptimisticTxPrepareFuture.proceedPrepare()}} method that should not 
make progress (send next request) in case of timeout happened. Instead it 
should call deadlock detection task and finish without future completion.

Synchronization primitive in this case just atomic reference that contains 
{{null}} value before timeout. So we initialize this reference by deadlock 
detection task (some kind of {{Runnable}}) on timeout and use {{cas(null, 
null)}} before make progress in {{proceedPrepare}} method.

Thus deadlock detection can be started only when there are now requests in 
progress. It will allow to avoid creation {{DhtTxLocal}} and {{DhtTxRemote}} 
instances after or concurrently with transaction finishing.

I've implemented POC and it seems to work.

Does it makes sense?

> 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)


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-05-10 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Changes in {{GridDhtTxPrepareFuture}} affects pessimistic transactions. So 
deadlock detection modified for pessimistic transactions.

Solution for fixing race in {{GridDhtTxPrepareFuture}} and 
{{GridNearOptimisticTxPrepareFuture}} is in progress.

> 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.6
>
>
> Deadlock detection doesn't support optimistic transactions now. It should be 
> implemented.



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


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-04-29 Thread Semen Boikov (JIRA)

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

Semen Boikov commented on IGNITE-2969:
--

Andrey,

Looked at your changes, I think you need implement proper synchronization in 
GridDhtTxPrepareFuture between future timeout and 'normal' future processing. 
Is it possible now that PrepareTimeoutObject completed future, but some other 
thread still continue to process 
GridDhtTxPrepareRequest/GridDhtTxPrepareResponses? (the same for 
GridNearOptimisticTxPrepareFuture).

> 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.6
>
>
> Deadlock detection doesn't support optimistic transactions now. It should be 
> implemented.



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


[jira] [Commented] (IGNITE-2969) Optimistic transactions support in deadlock detection

2016-04-28 Thread Andrey Gura (JIRA)

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

Andrey Gura commented on IGNITE-2969:
-

Implemented using timeout objects in {{GridNearOptimisticTxPrepareFuture}} and 
{{GridDhtTxPrepareFuture}}. Detection related part in {{TxManager}} class 
modified in order to use {{GridNearOptimisticTxPrepareFuture}}.

Also added some timeouts handling.

In rare cases tests can fail due to an unfinished {{GridDhtTxRemote}} 
instances. Need review and some advice about this problem.

> 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.6
>
>
> Deadlock detection doesn't support optimistic transactions now. It should be 
> implemented.



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