diff options
Diffstat (limited to 'src/mongo/db/s/auto_split_vector_command.cpp')
| -rw-r--r-- | src/mongo/db/s/auto_split_vector_command.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/db/s/auto_split_vector_command.cpp b/src/mongo/db/s/auto_split_vector_command.cpp index 821527cac7d..dc4effd9b15 100644 --- a/src/mongo/db/s/auto_split_vector_command.cpp +++ b/src/mongo/db/s/auto_split_vector_command.cpp @@ -39,7 +39,8 @@ namespace mongo { namespace { -static constexpr int64_t kSmallestChunkSizeSupported = 1024 * 1024; +static constexpr int64_t kSmallestChunkSizeBytesSupported = 1024 * 1024; +static constexpr int64_t kBiggestChunkSizeBytesSupported = 1024 * 1024 * 1024; class AutoSplitVectorCommand final : public TypedCommand<AutoSplitVectorCommand> { public: @@ -75,16 +76,19 @@ public: const auto& req = request(); uassert(ErrorCodes::ErrorCodes::InvalidOptions, - str::stream() << "maxChunksSizeBytes cannot be smaller than " - << kSmallestChunkSizeSupported, - req.getMaxChunkSizeBytes() >= kSmallestChunkSizeSupported); + str::stream() << "maxChunksSizeBytes must lie within the range [" + << kSmallestChunkSizeBytesSupported / (1024 * 1024) << "MB, " + << kBiggestChunkSizeBytesSupported / (1024 * 1024) << "MB]", + req.getMaxChunkSizeBytes() >= kSmallestChunkSizeBytesSupported && + req.getMaxChunkSizeBytes() <= kBiggestChunkSizeBytesSupported); auto [splitPoints, continuation] = autoSplitVector(opCtx, ns(), req.getKeyPattern(), req.getMin(), req.getMax(), - req.getMaxChunkSizeBytes()); + req.getMaxChunkSizeBytes(), + req.getLimit()); Response autoSplitVectorResponse(std::move(splitPoints)); autoSplitVectorResponse.setContinuation(continuation); return autoSplitVectorResponse; |
