Given a large enough page is created a by a transaction running in WiredTiger, it may get force evicted causing a rollback to be returned to the transaction, the transaction also needs to be the oldest transaction in the system and meet the criteria to be "blocking", see: __wt_txn_is_blocking. However this behaviour is also impacting MongoDB transactions.
The original change
WT-6444 was intended to rollback batch operations and have the mongodb layer split them into smaller chunks, as a consequence of this change we are rolling back more than we intended.
There are two possible fixes here:
- Improve the heuristic used to determine whether we should roll back a transaction.
- Have MongoDB supply a config to WiredTiger to identify that a MongoDB transaction is running, and skip the rollback logic.
I've created a python reproducer for this scenario: