In 3.0, the host targeting logic on mongos only works for the explain command if explaining a find operation. If an explain of a count or group operation is routed through mongos with a read preference, the read preference is ignored. As a result, these explains are always delivered to the primary node, even for read preferences like "secondary" or "secondaryPreferred".
This has already been fixed in the 3.1.8 development version under SERVER-19341. Therefore, the issue only affects the 3.0 branch. (It does not affect 2.6 or previous versions because find was the only explainable operation in these versions.)
- is related to
-
SERVER-21661 v3.0 mongos and v3.2 cluster explain command are not compatible
- Closed
-
SERVER-19341 Finalize how read preference and slaveOk are passed for the find command
- Closed