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

Denis Chudov updated IGNITE-18192:
----------------------------------
    Description: 
*Motivation:*
In some cases we need to change lock mode depending on current lock which is 
held on the key. This is impossible to do using existing Lock Manager API, 
because a lock mode can be changed concurrently on the same key in the same 
transaction.
Required a new method in API which would allow choosing lock mode depending on 
previous. This choice should be made in a critical section, where another 
thread cannot change the mode until a new one is chosen.

*Definition of done:*
Added a method to LockManager:
{{CompletableFuture<Lock> acquire(UUID txId, LockKey lockKey, 
Function<LockMode, LockMode>);}}

The function passed as a parameter, should accept the current lock mode and 
return a lock mode that is supposed to be acquired by the method.

  was:
*Motivation:*
In some case we need to change lock mode depends on current lock which is held 
in the key. This is impossible through Lock Manager API, because a lock mode 
can change concurrently in the same key on the same transaction.
Required a new method in API which allow choosing lock mode depends on 
previous. This choosing should be acted in a critical section, where another 
thread cannot change the mode until a new one is chosen.

*Implementation notes:*
Add a method to _LockManager_:
CompletableFuture<Lock> acquire(UUID txId, LockKey lockKey, Function<LockMode, 
LockMode>);


> Conditional lock
> ----------------
>
>                 Key: IGNITE-18192
>                 URL: https://issues.apache.org/jira/browse/IGNITE-18192
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Vladislav Pyatkov
>            Priority: Major
>              Labels: ignite-3
>
> *Motivation:*
> In some cases we need to change lock mode depending on current lock which is 
> held on the key. This is impossible to do using existing Lock Manager API, 
> because a lock mode can be changed concurrently on the same key in the same 
> transaction.
> Required a new method in API which would allow choosing lock mode depending 
> on previous. This choice should be made in a critical section, where another 
> thread cannot change the mode until a new one is chosen.
> *Definition of done:*
> Added a method to LockManager:
> {{CompletableFuture<Lock> acquire(UUID txId, LockKey lockKey, 
> Function<LockMode, LockMode>);}}
> The function passed as a parameter, should accept the current lock mode and 
> return a lock mode that is supposed to be acquired by the method.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to