You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "naresh.goty" <gn...@gmail.com> on 2017/10/09 19:08:43 UTC

Lock on cache keys during node failures

Hi All,

We would like to understand the lock behavior on cache items, based on the
code snippet below:

1. What happens if the key "fake" in cache1 is lost (due to node failure,
part data lost etc) after the lock is acquired and before it is released ?         
2. What happens, if another thread (t2) tries to acquire lock on the key
"fake" in cache1 after the lock was acquired by thread (t1) and the key was
lost and before the lock was release by thread t1 ?
3. What are the resiliency guarantees on the lock on a key in a cache ?


IgniteCache<Object, Object> cache1 =
ignite.getOrCreateCache(getConfig("cache1"));
Lock lock = cache1.lock("fake");                                
try{
   lock.lock();
   //do something                 
}finally{
   lock.unlock();
}

Thanks,
Naresh   





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Lock on cache keys during node failures

Posted by "naresh.goty" <gn...@gmail.com>.
Thanks Alex.

We would like to know if the key is lost due to node failure, does the lock
holding that key still exists(or valid)? What are the resiliency guarantees
of the lock on a key in a cache 


Thanks,
Naresh



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Lock on cache keys during node failures

Posted by afedotov <al...@gmail.com>.
Hi Naresh,

In case of a node failure, all the locks acquired by that node will be
released.
So, if there is a node waiting on any of such keys it should eventually
acquire the lock.

Kind regards,
Alex



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/