sharded_agg_helpers::dispatchShardPipeline() uses the read preference set on the OperationContext already and therefore ignores the read preference on the AggregateCommandRequest that's passed into sharded_agg_helpers::targetShardsAndAddMergeCursors() by ReshardingCollectionCloner.
Acceptance criteria: Run reshard_collection_cloner.js and manually verify the profiler entry for the aggregate command can be found on a secondary. If possible, also verify the $readPreference for the aggregate was sent with nearest
- causes
-
SERVER-61945 Resharding collection cloning may fail with NamespaceNotSharded when "nearest" read preference chooses secondary
- Closed
- is related to
-
SERVER-57686 We need test coverage that runs resharding in the face of elections
- Closed