This is a regression introduce by this line in this commit on 3.6, where we pulled the StaleShardVersion handling in mongos up from scatterGather() to strategy::runCommand().
There are no tests that run "find explain" (which is the only thing that goes through the legacy query path that does not internally handle StaleShardVersion) from a stale mongos with --shellReadMode=legacy, so this was not caught.
See attached repro, which should be run with --shellReadMode=legacy to make the "find explain" go through the legacy query path on mongos.
- is related to
-
SERVER-29449 Explain of find command does not transform query for shards
- Backlog