[SERVER-42747] validate_collections_on_shutdown.js should be resilient to elections Created: 09/Aug/19 Updated: 06/Dec/22 Resolved: 12/Aug/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Russotto | Assignee: | Backlog - Replication Team |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Assigned Teams: |
Replication
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 5 | ||||||||||||||||||||
| Description |
|
validate_collections_on_shutdown attempts to step down the node, then to freeze it. It assumes that if replSetFreeze fails with NotSecondary, it means the node is not initialized. Unfortunately, this can also happen if an election is running; in that case the node will not step down (because it is not master) nor freeze (because it is running an election). This situation can be detected because replSetStepDown will return NotMaster in that case; if replSetStepDown returns NotMaster and replSetFreeze returns NotSeconday, we should skip collection validation. |
| Comments |
| Comment by Matthew Russotto [ 12/Aug/19 ] |
|
That would work too, though the existing test just tends to skip on most errors. |
| Comment by Judah Schvimer [ 09/Aug/19 ] |
|
Rather than skipping validation in this circumstance, can we just wait a bit and retry the stepdown and freeze? |