Problem: The resharding command fails if the newShardKeyProjection size * samplePerChunk * intialNumOfChunks is bigger than 100MB.
newShardKeyProjection: size of newShardKey document
Default value of initialNumOfChunks is the existing number of chunks before the resharding.
Default value of samplePerChunk: 10
Description: Resharding creates a pipeline query command and the query is then sorted on the new Shard Key as part of the projection. If the projection of over 100MB is passed onto sort, the following error is thrown
The error is due to
ReshardingSplitPolicy::_makePipelineDocumentSource creating ExpressionContext with allowDiskUse to false.
Steps to reproduce:
Attached .js test and initial_split_policy.h to change the kDefaultSamplesPerChunk to 10000(from 10)