You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Alexey Goncharuk (JIRA)" <ji...@apache.org> on 2017/06/29 07:41:00 UTC

[jira] [Created] (IGNITE-5613) AtomicSequence usage inside transactions may cause deadlock

Alexey Goncharuk created IGNITE-5613:
----------------------------------------

             Summary: AtomicSequence usage inside transactions may cause deadlock
                 Key: IGNITE-5613
                 URL: https://issues.apache.org/jira/browse/IGNITE-5613
             Project: Ignite
          Issue Type: Bug
          Components: cache
    Affects Versions: 1.5.0.final
            Reporter: Alexey Goncharuk
             Fix For: 2.1


Consider the following update scenario:
{code}
Thread 1:
Transaction tx = txStart() {
    get(key); // Acquires lock;
    seq.incrementAndGet();
}

Thread 2:
seq.incrementAndGet();
{code}

Let's now assume that:
 * Sequence is exhausted and needs a non-local update
 * Thread 1 acquired lock on topology version N
 * Topology version changes
 * Thread 2 now calls incrementAndGet(), updates the sequence local guard and starts transaction which waits for topology version N+1 to become available
 * Thread 1 attemts to incrementAndGet().

Since guard is already changed, it waits for the concurrent update to complete



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