-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
If a secondary is in STARTUP2 or RECOVERING state it is still listed in the 'hosts' field of the ismaster response. Both the 'ismaster' and 'secondary' fields of the response will be set to False, so a monitor run will remove the member from the reader pool (or not, see PYTHON-455).
repl0:RECOVERING> db.adminCommand('ismaster') { "setName" : "repl0", "ismaster" : false, "secondary" : false, "hosts" : [ "behackett-dt:27019", "behackett-dt:27018", "behackett-dt:27017" ], "primary" : "behackett-dt:27017", "me" : "behackett-dt:27019", "maxBsonObjectSize" : 16777216, "ok" : 1 }
Unfortunately the monitor only runs every 30 seconds. We should schedule an immediate refresh of the pools in helpers._unpack_response or helpers._check_command_response if we get an error message like "node is recovering" or "not master ...".
NOTE: PYTHON-455 must be fixed first, or this change will make no difference.
- depends on
-
PYTHON-455 Replica set members not in primary/secondary state should not receive reads
- Closed
- is related to
-
JAVA-861 query being routed to recovering node when read_preference is secondary
- Closed
-
SERVER-7977 query being routed to recovering node when read_preference is secondary
- Closed