[SERVER-33095] make replica_set_error_codes.js more robust Created: 02/Feb/18  Updated: 29/Oct/23  Resolved: 09/Feb/18

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.7.2

Type: Improvement Priority: Major - P3
Reporter: Pavithra Vetriselvan Assignee: Pavithra Vetriselvan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-02-12, Repl 2018-02-26
Participants:
Linked BF Score: 0

 Description   

Currently, replica_set_error_codes.js has asserts that a particular node must become secondary. But it is not guaranteed that this node will always win because the other secondary may also run for an election and win instead.

Just call .getPrimary() instead, which blocks until a new primary is elected.



 Comments   
Comment by Githook User [ 09/Feb/18 ]

Author:

{'email': 'pavithra.vetriselvan@mongodb.com', 'name': 'Pavithra Vetriselvan'}

Message: SERVER-33095 call getPrimary instead of asserting secondary1 is primary
Branch: master
https://github.com/mongodb/mongo/commit/46b911217be85acb992879bd693b0c50280f494b

Generated at Thu Feb 08 04:32:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.