diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/s/auto_split_vector_command.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/s/split_vector_command.cpp | 4 |
2 files changed, 9 insertions, 2 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(), diff --git a/src/mongo/db/s/split_vector_command.cpp b/src/mongo/db/s/split_vector_command.cpp index 9754207a8bd..b485c08361c 100644 --- a/src/mongo/db/s/split_vector_command.cpp +++ b/src/mongo/db/s/split_vector_command.cpp @@ -146,8 +146,8 @@ public: } uassert(ErrorCodes::InvalidOptions, - "The specified max chunk size must be greater than 0", - ret == boost::none || *ret > 0); + "The specified max chunk size must be at least 1MB", + ret == boost::none || *ret >= 1024 * 1024); return ret; }(); |