-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
0
-
None
-
3
-
TBD
-
None
-
None
-
None
-
None
-
None
-
None
Summary:
The awaitReplication method retrieves the lastAppliedOp via the replSetGetStatus command. However, the replSetGetStatus command can fail when the node is in the STARTUP state, but will return complete information if the node transitions to the STARTUP2 state. This behavior introduces a potential issue: awaitReplication can observe an updated lastAppliedOp and complete, even though the node remains in the STARTUP2 state and is unable to serve reads.
While this issue can be mitigated by combining awaitReplication with awaitSecondaryNodes, this step is occasionally overlooked, leading to test flakiness. For instance, this issue has been observed in cases like BF-38164.
Proposal:
Prevent the awaitReplication method from returning success if any node in the replication set is still in the STARTUP2 state. This enhancement would reduce test flakiness and ensure robust behavior in scenarios relying on replication state.