[SERVER-50192] mongod --replSet --repair fails with NotMasterNoSlaveOk error Created: 08/Aug/20 Updated: 29/Oct/23 Resolved: 09/Aug/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | 4.0.19, 4.2.8, 4.4.0 |
| Fix Version/s: | 5.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bruce Lucas (Inactive) | Assignee: | Jackson Xie (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | Execution Team 2021-08-09, Execution Team 2021-08-23 | ||||||||
| Participants: | |||||||||
| Case: | (copied to CRM) | ||||||||
| Description |
|
Create a 3-node replica set, shut it down, then restart with --repair. The repair does not complete, failing part way through with the following error:
This happens on all 3 nodes. Debug level 5 logs attached. |
| Comments |
| Comment by Githook User [ 09/Aug/21 ] | |
|
Author: {'name': 'Jackson Xie', 'email': 'jackson.xie@mongodb.com', 'username': 'jacksonx9'}Message: | |
| Comment by Eric Milkie [ 10/Aug/20 ] | |
|
Hmm. I did try by starting, exiting, and then running repair. But I also initiated the replica set as part of the initial startup/shutdown, which would more likely represent the data on servers in production. | |
| Comment by Bruce Lucas (Inactive) [ 10/Aug/20 ] | |
|
I saw those errors if I started a brand new fresh mongod with both --replSet and --repair, which is a very unusual scenario. I found that if I started mongod, then exited, then started again with --\replSet and --repair the repair worked on 4.0 and 4.2 without problems. Are you seeing something different? In that sense I think this is a bit of a regression in 4.4. | |
| Comment by Eric Milkie [ 10/Aug/20 ] | |
|
Same error on 4.0. | |
| Comment by Eric Milkie [ 10/Aug/20 ] | |
|
The error on 4.2:
| |
| Comment by Bruce Lucas (Inactive) [ 08/Aug/20 ] | |
|
So this only happens if mongod is run with both --replSet and --repair, so could be considered user error. However possibly we should detect that condition and exit with a helpful error message. |