Details
Description
If a truncate of the oplog occurs (
WiredTigerRecordStore::OplogStones::clearStonesOnCommit), it first: * Sets the number of current records and bytes for the new OplogStone to 0
- Acquires the modification mutex
- Clears the stones list
Modifying the first two variable outside of the lock could potentially lead to an invalid state since other OplogStones modifications first take the mutex then perform the other modifications.
We should protect the first two variables under the mutex to avoid potential invalid states. The attached patch fixes this.