summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Lerner <alerner@10gen.com>2010-10-20 16:19:56 -0400
committerEliot Horowitz <eliot@10gen.com>2010-10-26 15:51:25 -0400
commit0737ad69095b8d0d036805705f989f76ca81bc86 (patch)
treefda655bd73331beee10e73db2dcf9fc07ddf9202
parentb41a9f678c72ecaa2f509df00ef79c67d216d662 (diff)
downloadmongo-0737ad69095b8d0d036805705f989f76ca81bc86.tar.gz
SERVER-1979 check max key before requesting a move
-rw-r--r--s/balance.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/s/balance.cpp b/s/balance.cpp
index f79e1d8e060..33cafdfc9da 100644
--- a/s/balance.cpp
+++ b/s/balance.cpp
@@ -54,13 +54,13 @@ namespace mongo {
const BSONObj& chunkToMove = chunkInfo.chunk;
ChunkPtr c = cm->findChunk( chunkToMove["min"].Obj() );
- if ( c->getMin().woCompare( chunkToMove["min"].Obj() ) ){
+ if ( c->getMin().woCompare( chunkToMove["min"].Obj() ) || c->getMax().woCompare( chunkToMove["max"].Obj() ) ) {
// likely a split happened somewhere
- cm = cfg->getChunkManager( chunkInfo.ns , true );
+ cm = cfg->getChunkManager( chunkInfo.ns , true /* reload */);
assert( cm );
c = cm->findChunk( chunkToMove["min"].Obj() );
- if ( c->getMin().woCompare( chunkToMove["min"].Obj() ) ){
+ if ( c->getMin().woCompare( chunkToMove["min"].Obj() ) || c->getMax().woCompare( chunkToMove["max"].Obj() ) ) {
log() << "chunk mismatch after reload, ignoring will retry issue cm: "
<< c->getMin() << " min: " << chunkToMove["min"].Obj() << endl;
continue;