-
Type: Bug
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
ALL
-
10
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.
To break this cycle, we could add a periodic wakeup when waiting for prepared transactions to commit or abort. Something like 100ms. This would allow the reader to make progress and unpin the problematic page.
- is related to
-
SERVER-65106 Don't perform eviction after prepared transaction commits or rolls-back
- Closed
- related to
-
WT-8975 Eviction is triggered with prepared transactions
- Closed