diff options
author | Antonin Kral <a.kral@bobek.cz> | 2010-08-18 09:26:34 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2010-08-18 09:26:34 +0200 |
commit | 99da8d4003cd4619c8655f4a9db74e567d458e68 (patch) | |
tree | 7ffe10ec1cd5f0f86be0b7b6f46a935c5f279046 /s/chunk.cpp | |
parent | 63f119d2d1a2ed62bc492b427fc498c3c3989149 (diff) | |
parent | 0a9f6162d232e4fb4b70ca07c4a65c0a12173cfc (diff) | |
download | mongodb-99da8d4003cd4619c8655f4a9db74e567d458e68.tar.gz |
Merge commit 'upstream/1.6.1'
Diffstat (limited to 's/chunk.cpp')
-rw-r--r-- | s/chunk.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/s/chunk.cpp b/s/chunk.cpp index 5df3b69..50d4e76 100644 --- a/s/chunk.cpp +++ b/s/chunk.cpp @@ -265,7 +265,7 @@ namespace mongo { } // Save the new key boundaries in the configDB. - _manager->save(); + _manager->save( false ); // Log all these changes in the configDB's log. We log a simple split differently than a multi-split. if ( newChunks.size() == 1) { @@ -584,7 +584,7 @@ namespace mongo { _shards.insert(c->getShard()); - save_inlock(); + save_inlock( true ); log() << "no chunks for:" << ns << " so creating first: " << c->toString() << endl; } } @@ -880,16 +880,18 @@ namespace mongo { configServer.logChange( "dropCollection" , _ns , BSONObj() ); } - void ChunkManager::save(){ + void ChunkManager::save( bool major ){ rwlock lk( _lock , true ); - save_inlock(); + save_inlock( major ); } - void ChunkManager::save_inlock(){ + void ChunkManager::save_inlock( bool major ){ ShardChunkVersion a = getVersion_inlock(); assert( a > 0 || _chunkMap.size() <= 1 ); - ShardChunkVersion nextChunkVersion = a.incMajor(); + ShardChunkVersion nextChunkVersion = a; + nextChunkVersion.inc( major ); + vector<ChunkPtr> toFix; vector<ShardChunkVersion> newVersions; @@ -907,7 +909,7 @@ namespace mongo { _sequenceNumber = ++NextSequenceNumber; ShardChunkVersion myVersion = nextChunkVersion; - ++nextChunkVersion; + nextChunkVersion.incMinor(); toFix.push_back( c ); newVersions.push_back( myVersion ); |