summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2022-12-05 09:04:57 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-05 18:11:12 +0000
commit89b2e659a29e08418ea99989043cc7a32591d146 (patch)
tree8718686bae4be89f2844ca993db68ca595db80aa
parentd3fab9c982d592da79239690b9da926ccb49b28b (diff)
downloadmongo-89b2e659a29e08418ea99989043cc7a32591d146.tar.gz
SERVER-71788 Defragmentation should handle ChunkTooBig errors
(cherry picked from commit 76d4cb7bd5b3654f7e3bba3aaf9fbb5c766476a4)
-rw-r--r--src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp b/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp
index b1521933098..a397731d6b2 100644
--- a/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp
+++ b/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp
@@ -521,6 +521,14 @@ public:
moveRequest.chunkToMove->busyInOperation = false;
moveRequest.chunkToMergeWith->busyInOperation = false;
+ if (migrationResponse.code() == ErrorCodes::ChunkTooBig ||
+ migrationResponse.code() == ErrorCodes::ExceededMemoryLimit) {
+ // Never try moving this chunk again, it isn't actually small
+ _removeIteratorFromSmallChunks(moveRequest.chunkToMove,
+ moveRequest.chunkToMove->shard);
+ return;
+ }
+
if (isRetriableForDefragmentation(migrationResponse)) {
// The migration will be eventually retried
return;
@@ -711,7 +719,7 @@ private:
chunkToMove->range.getMin(),
chunkToMove->range.getMax(),
version,
- ForceJumbo::kForceBalancer,
+ ForceJumbo::kDoNotForce,
maxChunkSizeBytes);
}