Consider the following behavior when running the
- You cannot run the command on the Primary.
- You must run the command against the
replSetMaintenance: true, the member enters the
RECOVERINGstate. While the secondary is
- The member is not accessible for read operations.
- The member continues to sync its oplog from the Primary.
- When a node receives a
replSetMaintenance: truerequest, it adds a maintenance mode task to a queue of tasks. If the queue of tasks was empty and now is not, the node will transition to
RECOVERINGstate and begin to reject read requests. When a node receives a
replSetMaintenance: falserequest, it removes a maintenance mode task from the queue (even if that task was initiated by a different client). If the request empties the maintenance mode task queue, the node will return to
- If you want to prevent a node from servicing reads, consider using Hidden Replica Set Members instead.