Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

reload chunks on error

  • Loading branch information...
commit 8df6518e62d98201aa281dc500d28f9901228283 1 parent 67575ac
@erh erh authored
Showing with 19 additions and 12 deletions.
  1. +19 −12 s/chunk.cpp
View
31 s/chunk.cpp
@@ -534,20 +534,27 @@ namespace mongo {
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 (it != _chunkMap.end()){
- Chunk* c = it->second;
- if ( c->contains( obj ) ){
+ if ( c ){
+ if ( c->contains( obj ) )
return *c;
- }
- else{
- PRINT(it->first);
- PRINT(*c);
- PRINT(key);
- massert(13141, "Chunk map pointed to incorrect chunk", false);
- }
+
+ PRINT(foo);
+ PRINT(*c);
+ PRINT(key);
+
+ _reload();
+ massert(13141, "Chunk map pointed to incorrect chunk", false);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.