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

Fix deadlock with checkpoint waiting for transactions to complete

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Critical - P2
    • Resolution: Fixed
    • None
    • WT11.0.0, 6.1.0-rc0, 6.0.0-rc4
    • None
    • v6.0

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: