[ 
https://issues.apache.org/jira/browse/IGNITE-4908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anton Vinogradov updated IGNITE-4908:
-------------------------------------
    Description: 
Design discussed with Alexander:

1) Lock 
Entry Processor (sync) -> 
....add candidate. 
....returns "added candidate at first position"
....retry failover -> 
........if already at first position -> return true
In case lock not acquired, wait for acquire (AbstractQueuedSynchronizer should 
be used).

2) Unlock 
Entry Processor (async) -> 
....remove candidate at first position
....retry failover -> remove only if "candidate at first position" equals to 
expected
....listener ->
........notify current "candidate at first position" it got lock

3)Failover
3.1) Originating node failed
Failed node listener ->
....For each local(primary) lock ->
........Entry Processor (async) ->
............remove candidates related no failed node
............retry failover not needed
............listener -> 
................if "candidate at first position" removed ->
....................notify current "candidate at first position" it got lock

3.2) Primary node failed
After rebalancing schedule Callable ->
....For each local(primary) lock ->
........Entry Processor (async) ->........ 
............remove candidates related to failed nodes
............retry failover not needed
............listener -> 
................notify current "candidate at first position" it got lock....

  was:
1) Lock 
Entry Processor (sync) -> 
....add candidate. 
....returns "added candidate at first position"
....retry failover -> 
........if already at first position -> return true
In case lock not acquired, wait for acquire (AbstractQueuedSynchronizer should 
be used).

2) Unlock 
Entry Processor (async) -> 
....remove candidate at first position
....retry failover -> remove only if "candidate at first position" equals to 
expected
....listener ->
........notify current "candidate at first position" it got lock

3)Failover
3.1) Originating node failed
Failed node listener ->
....For each local(primary) lock ->
........Entry Processor (async) ->
............remove candidates related no failed node
............retry failover not needed
............listener -> 
................if "candidate at first position" removed ->
....................notify current "candidate at first position" it got lock

3.2) Primary node failed
After rebalancing schedule Callable ->
....For each local(primary) lock ->
........Entry Processor (async) ->........ 
............remove candidates related to failed nodes
............retry failover not needed
............listener -> 
................notify current "candidate at first position" it got lock....


> Ignite.reentrantLock looks much slower than IgniteCache.lock.
> -------------------------------------------------------------
>
>                 Key: IGNITE-4908
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4908
>             Project: Ignite
>          Issue Type: Improvement
>          Components: data structures
>    Affects Versions: 1.8
>            Reporter: Andrew Mashenkov
>            Assignee: Alexander Menshikov
>             Fix For: 2.3
>
>
> Design discussed with Alexander:
> 1) Lock 
> Entry Processor (sync) -> 
> ....add candidate. 
> ....returns "added candidate at first position"
> ....retry failover -> 
> ........if already at first position -> return true
> In case lock not acquired, wait for acquire (AbstractQueuedSynchronizer 
> should be used).
> 2) Unlock 
> Entry Processor (async) -> 
> ....remove candidate at first position
> ....retry failover -> remove only if "candidate at first position" equals to 
> expected
> ....listener ->
> ........notify current "candidate at first position" it got lock
> 3)Failover
> 3.1) Originating node failed
> Failed node listener ->
> ....For each local(primary) lock ->
> ........Entry Processor (async) ->
> ............remove candidates related no failed node
> ............retry failover not needed
> ............listener -> 
> ................if "candidate at first position" removed ->
> ....................notify current "candidate at first position" it got lock
> 3.2) Primary node failed
> After rebalancing schedule Callable ->
> ....For each local(primary) lock ->
> ........Entry Processor (async) ->........ 
> ............remove candidates related to failed nodes
> ............retry failover not needed
> ............listener -> 
> ................notify current "candidate at first position" it got lock....



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to