summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2022-04-29 08:49:48 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-29 09:32:51 +0000
commitb25bbb083350c46e59bd5f66a7a44d7dfbdbbd1a (patch)
treec5af4a635cc51991e613b544cec52d7fd1ac451b
parent5972174b530756d5165d3ec5ac7c5d0a3febfa5e (diff)
downloadmongo-b25bbb083350c46e59bd5f66a7a44d7dfbdbbd1a.tar.gz
SERVER-66041 Chunk cloner must never consider `too big` a chunk with only one document
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
index 60283e5d348..ea96a150442 100644
--- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
+++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
@@ -877,7 +877,7 @@ Status MigrationChunkClonerSourceLegacy::_storeCurrentLocs(OperationContext* opC
if (avgRecSize == 0) {
avgRecSize = BSONObj::kMinBSONLength;
}
- maxRecsWhenFull = _args.getMaxChunkSizeBytes() / avgRecSize;
+ maxRecsWhenFull = std::max(_args.getMaxChunkSizeBytes() / avgRecSize, 1LL);
maxRecsWhenFull = 2 * maxRecsWhenFull; // pad some slack
} else {
avgRecSize = 0;