summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2022-12-12 11:40:05 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-12 12:18:42 +0000
commit98299022319738fa162ef7fe7bbbc5d1842a6e22 (patch)
tree9051f821ee75e36af58148a6bf5d9858557538dd
parent765bcbfe11868dab720e50d4d03d71383f784cbd (diff)
downloadmongo-98299022319738fa162ef7fe7bbbc5d1842a6e22.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 952448cd219..63b2b8e4d22 100644
--- a/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp
+++ b/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp
@@ -517,6 +517,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,
- MoveChunkRequest::ForceJumbo::kForceBalancer);
+ MoveChunkRequest::ForceJumbo::kDoNotForce);
}
ChunkRange asMergedRange() const {