Skip to content

Commit

Permalink
reload chunks on error
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Apr 30, 2010
1 parent 67575ac commit 8df6518
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions s/chunk.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -534,20 +534,27 @@ namespace mongo {
BSONObj key = _key.extractKey(obj); BSONObj key = _key.extractKey(obj);


{ {
rwlock lk( _lock , false ); BSONObj foo;
Chunk * c = 0;
{
rwlock lk( _lock , false );
ChunkMap::iterator it = _chunkMap.upper_bound(key);
if (it != _chunkMap.end()){
foo = it->first;
c = it->second;
}
}


ChunkMap::iterator it = _chunkMap.upper_bound(key); if ( c ){
if (it != _chunkMap.end()){ if ( c->contains( obj ) )
Chunk* c = it->second;
if ( c->contains( obj ) ){
return *c; return *c;
}
else{ PRINT(foo);
PRINT(it->first); PRINT(*c);
PRINT(*c); PRINT(key);
PRINT(key);
massert(13141, "Chunk map pointed to incorrect chunk", false); _reload();
} massert(13141, "Chunk map pointed to incorrect chunk", false);
} }
} }


Expand Down

0 comments on commit 8df6518

Please sign in to comment.