Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-65106

Don't perform eviction after prepared transaction commits or rolls-back

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • Execution Team 2023-03-06
    • 10

      This is an alternative solution to both SERVER-64613 and WT-8975.

      When MongoDB encounters a prepare conflict in WiredTiger, we wait until an active MongoDB WriteUnitOfWork commits or aborts.

      There is a deadlock caused by this approach that can be described as follows:

      • A prepared transaction has updated a document.
      • A concurrent operation tries to read that document, but it hits a prepare conflict. It waits until the prepared transactions commits or aborts (via a notification). While it waits, its cursor remains positioned, preventing the page from being evicted.
      • The prepared transaction aborts or commits, but after the transition rolls-back, it is recruited for bonus eviction. It cannot evict anything because the page is pinned by the reader. So even though the transaction has been successfully rolled back in the storage engine, cannot make progress to signal the reader to continue. The reader is waiting for a notification, which would unpin the page.

      This is only a bug in a system with one prepared transaction, since any transactions committing or aborting would wake the reader.

      We want to break this deadlock in MongoDB by requesting to WiredTiger that the operation not perform eviction after it rolls back or commits.

            Assignee:
            louis.williams@mongodb.com Louis Williams
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: