Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-5613

AtomicSequence usage inside transactions may cause deadlock

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.0.final
    • 2.1
    • cache

    Description

      Consider the following update scenario:

      Thread 1:
      Transaction tx = txStart() {
          get(key); // Acquires lock;
          seq.incrementAndGet();
      }
      
      Thread 2:
      seq.incrementAndGet();
      

      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(), acquires lock and starts transaction which waits for topology version N+1 to become available
      • Thread 1 attemts to incrementAndGet().

      Since the lock is already held, thread 2 waits for the concurrent update to complete

      Attachments

        Activity

          People

            agoncharuk Alexey Goncharuk
            agoncharuk Alexey Goncharuk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: