-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.2.0-rc2
-
Component/s: Replication
-
None
-
ALL
-
0
recover_prepared_transactions_startup_secondary_application.js prepares a transaction, then restarts a secondary and queries it, expecting it to be in state SECONDARY. Sometimes the query fails, however, with "node is recovering". This is due to a race in the test. The test thinks that waiting for the prepare entry to be majority-committed implies that the restarted node has transitioned to state SECONDARY, but this is not always so.
* Create a 2-node set * Prepare a transaction * In either order: * The secondary restarts & transitions to RECOVERING * The prepare entry is majority-committed * The test waits for the prepare entry to be majority-committed * The test queries the restarted node
If the secondary restarts before the prepare is majority-committed, then waiting for the majority commit is the same as waiting for the restarted node to become SECONDARY, so querying the node is fine.
If the secondary restarts after the prepare is majority-committed, then waiting for the majority commit is insufficient. The node could still be in RECOVERING and reject the query.
- duplicates
-
SERVER-41718 recover_prepared_transactions_startup_secondary_application.js should wait for node to be in the secondary state before reading from it
- Closed
- is caused by
-
SERVER-41008 Check lastCommittedOpTime instead of awaitReplication for prepare recovery/index build tests
- Closed