1. Derby
  2. DERBY-5632

Logical deadlock happened when freezing/unfreezing the database


    • Urgency:
    • Bug behavior facts:
      Seen in production


      Tried to make a quick database backup by freezing the database, performing a ZFS snapshot, and then unfreezing the database. The database was frozen but then a connection to the database could not be established to unfreeze the database.

      Looking at the stack trace of the network server, , I see 3 threads that are trying to process a connection request. Each of these is waiting on:

      at Source)

      • waiting to lock <0xfffffffd3a7fcc68> (a

      That object is owned by:

      • locked <0xfffffffd3a7fcc68> (a
        at Source)
        at Source)
        at Source)
        at Source)
        at org.apache.derby.impl.sql.execute.AlterTableConstantAction.updateStatistics(Unknown Source)

      which itself is waiting for the object:

      at java.lang.Object.wait(Native Method)

      • waiting on <0xfffffffd3ac1d608> (a
        at java.lang.Object.wait(
        at Source)
      • locked <0xfffffffd3ac1d608> (a
        at Source)
        at Source)

      So basically what I think is happening is that the database is frozen, the statistics are being updated on another thread which has the "" locked and then waits for the LogToFile lock and the connecting threads are waiting to lock "" to connect and these are where the database is going to be unfrozen. Not a deadlock as far as the JVM is concerned but it will never leave this state either.

      1. stack.txt
        107 kB
        Brett Bergquist
      2. experimental-v1.diff
        10 kB
        Knut Anders Hatlen
      3. experimental-v2.diff
        11 kB
        Knut Anders Hatlen

        Issue Links

        There are no Sub-Tasks for this issue.



            • Assignee:
              Knut Anders Hatlen
              Brett Bergquist
            • Votes:
              0 Vote for this issue
              4 Start watching this issue


              • Created: