Suppose you have the following configuration:
- version 2.8 mongo shell
- version 2.8 mongos
- version 2.6 shards
Based on the wire version reported by mongos, the shell will notice that the mongos has the explain command available. It will issue explains using the explain command rather than falling back to the $explain query flag.
However, the explain command on mongos explicitly fails unless all shards are version 2.8. This means that it is impossible to run explain with the above configuration. The shell should retry using legacy $explain in order to support explains in this configuration.