diff options
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/s/split_chunk.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/s/split_chunk.cpp b/src/mongo/db/s/split_chunk.cpp index 9e03e1cae96..651dc68f04a 100644 --- a/src/mongo/db/s/split_chunk.cpp +++ b/src/mongo/db/s/split_chunk.cpp @@ -109,9 +109,11 @@ bool checkMetadataForSuccessfulSplitChunk(OperationContext* opCtx, ChunkType nextChunk; for (auto it = splitPoints.begin(); it != splitPoints.end(); ++it) { // Check that all new chunks fit the new chunk boundaries - const auto& currentChunkMinKey = it == splitPoints.begin() ? chunkRange.getMin() : *it; + const auto& currentChunkMinKey = + it == splitPoints.begin() ? chunkRange.getMin() : *std::prev(it); + const auto& currentChunkMaxKey = *it; if (!metadataAfterSplit->getNextChunk(currentChunkMinKey, &nextChunk) || - nextChunk.getMax().woCompare(*it)) { + nextChunk.getMax().woCompare(currentChunkMaxKey)) { return false; } } |