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 | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/s/auto_split_vector_command.cpp b/src/mongo/db/s/auto_split_vector_command.cpp index 2b0657cc3ce..1748491cac6 100644 --- a/src/mongo/db/s/auto_split_vector_command.cpp +++ b/src/mongo/db/s/auto_split_vector_command.cpp @@ -39,6 +39,8 @@ namespace mongo { namespace { +static constexpr int64_t kSmallestChunkSizeSupported = 1024 * 1024; + class AutoSplitVectorCommand final : public TypedCommand<AutoSplitVectorCommand> { public: bool skipApiVersionCheck() const override { @@ -72,6 +74,11 @@ public: const auto& req = request(); + uassert(ErrorCodes::ErrorCodes::InvalidOptions, + str::stream() << "maxChunksSizeBytes cannot be smaller than " + << kSmallestChunkSizeSupported, + req.getMaxChunkSizeBytes() >= kSmallestChunkSizeSupported); + auto splitKeys = autoSplitVector(opCtx, ns(), req.getKeyPattern(), |