Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-9177

Fix deadlock with checkpoint waiting for transactions to complete

    • v6.0

      WT-9041 has added a section of code which waits for transactions to complete, __wt_txn_checkpoint_cannot_start so it can be sure that all the relevant transactions have committed.

      However if that transaction attempts to take a SCHEMA_LOCK the system can dead-lock.

      The order of operations is:

      1. Checkpoint prepare is called within a WT_WITH_SCHEMA_LOCK while a live transaction exists in the system
      2. Checkpoint waits for that transaction to complete with while(__wt_txn_checkpoint_cannot_start)
      3. That transaction attempts to open a cursor on a new dhandle with __wt_session_get_dhandle which takes a WT_WITH_SCHEMA_LOCK.
      4. Both threads wait indefinitely.

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            luke.pearson@mongodb.com Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: