-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
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.
- depends on
-
WT-9040 Configuration for transaction commit and rollback to skip eviction
- Closed
- is related to
-
SERVER-71674 Yield handlers not handling WCE thrown from restoring cursors
- Closed
-
SERVER-98113 Avoid cache eviction work during transaction rollback for operations that can't block
- Backlog
- related to
-
SERVER-64613 Periodically wake up when waiting for prepare conflicts
- Closed
-
WT-8975 Eviction is triggered with prepared transactions
- Closed