We should add "!ErrorCodes::isStaleShardingError() &&" when checking whether to discard an error from a shard because of the allowPartialResults flag.
https://github.com/mongodb/mongo/blob/r3.5.6/src/mongo/s/query/establish_cursors.cpp#L112-L115
// Unreachable host errors are swallowed if the 'allowPartialResults' option is set. if (allowPartialResults) { continue; }
This bug also exists in the ARM on 3.4 (although in 3.4, we didn't swallow retriable errors).
Also, should we really swallow all other errors? The only other error we check for on both 3.4 and 3.6 is ErrorCodes::CommandOnShardedViewNotSupportedOnMongod.
- related to
-
SERVER-31782 allow aggregation to take an 'allowPartialResults' option
- Backlog
-
SERVER-44126 Make AsyncResultsMerger only swallow retriable errors
- Closed