-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
ALL
-
v4.2
-
Repl 2019-11-04
-
8
recover_multiple_prepared_transactions_startup.js test should wait for majority commit point to advance before committing a prepared transaction.
Even though the test was running with a single node, after a restart, the lastCommitted is not set until the _firstOpTimeOfMyTerm is durable ( i.e. flushed) and by default we use the lastDurable to calculate the commit point. Therefore, the test races with the WTJournalFlusher thread flushing the first oplog entry after the restart. Committing a prepared transaction with lastCommitted being null is not allowed and will give error "commitTransaction for a prepared transaction cannot be run before its prepare oplog entry has been majority committed".