[SERVER-5921] Lightweight method to mark a replica as unhealthy Created: 24/May/12 Updated: 06/Dec/22 Resolved: 14/Jun/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin, Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Jon Hoffman | Assignee: | Backlog - Replication Team |
| Resolution: | Won't Fix | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Replication
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
At foursquare we implemented a method to mark a replica in a set as unhealthy. Here's how it works: the mongod monitors for the presence of a kill file. If the file is present, then the mongod will make itself ineligible to be primary of a replica set, including stepping down if it's already primary. It will also return its kill-file status via serverStatus so the mongoS can refuse to send queries to a killed secondary. Some more details:
Additional details:
We think it would be generally useful to build this functionality into the mainline code. Our customizations are here: https://github.com/foursquare/mongo/commit/6ff5bd021d98f25406b74b1cb89d276d0b403ce2 |
| Comments |
| Comment by Spencer Brody (Inactive) [ 14/Jun/18 ] |
|
You can already stepdown a node and tell it not to re-run for primary. Touching a file in the file system isn't noticeably easier than just running the stepdown command. This seems like extra complexity that doesn't belong in the server. |