Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

splits are now done by the mongod side

  • Loading branch information...
commit 910044f28a4c3c2a896fc7bd35e08c4f8c75063b 1 parent 8a50d05
Alberto Lerner authored
Showing with 12 additions and 10 deletions.
  1. +8 −6 s/chunk.cpp
  2. +2 −2 s/chunk.h
  3. +2 −2 s/d_split.cpp
View
14 s/chunk.cpp
@@ -283,17 +283,17 @@ namespace mongo {
return ChunkPtr();
}
+ //return multiSplit_DEPRECATED( splitPoint );
return multiSplit( splitPoint );
- //return multiSplit_ForDevOnly( splitPoint );
}
- ChunkPtr Chunk::multiSplit_ForDevOnly( const vector<BSONObj>& m ) {
+ ChunkPtr Chunk::multiSplit( const vector<BSONObj>& m ) {
// TODO use current multiSplit asserts here
ScopedDbConnection conn( getShard().getConnString() );
BSONObj result;
BSONObjBuilder cmd;
- cmd.append( "splitChunk_ForDevOnly" , _manager->getns() );
+ cmd.append( "splitChunk" , _manager->getns() );
cmd.append( "keyPattern" , _manager->getShardKey().key() );
cmd.append( "min" , getMin() );
cmd.append( "max" , getMax() );
@@ -329,8 +329,7 @@ namespace mongo {
return _manager->findChunk( m[0] );
}
- /* to be deprecated */
- ChunkPtr Chunk::multiSplit( const vector<BSONObj>& m ){
+ ChunkPtr Chunk::multiSplit_DEPRECATED( const vector<BSONObj>& m ){
dist_lock_try dlk( &_manager->_nsLock , string("split-") + toString() );
uassert( 10166 , "locking namespace failed" , dlk.got() );
@@ -1030,7 +1029,10 @@ namespace mongo {
}
void ChunkManager::save_inlock( bool major ){
-
+ // we do not update update the chunk manager on the mongos side any more
+ // the only exception case should be first chunk creation
+ assert( _chunkMap.size() == 1 );
+
ShardChunkVersion version = getVersion_inlock();
assert( version > 0 || _chunkMap.size() <= 1 );
ShardChunkVersion nextChunkVersion = version;
View
4 s/chunk.h
@@ -124,8 +124,8 @@ namespace mongo {
* @param splitPoints the vector of keys that should be used to divide this chunk
* @return shared pointer to the first new Chunk
*/
- /* to be deprecated */ ChunkPtr multiSplit( const vector<BSONObj>& splitPoints );
- ChunkPtr multiSplit_ForDevOnly( const vector<BSONObj>& splitPoints );
+ ChunkPtr multiSplit_DEPRECATED( const vector<BSONObj>& splitPoints );
+ ChunkPtr multiSplit( const vector<BSONObj>& splitPoints );
/**
* Asks the mongod holding this chunk to find a key that approximately divides this chunk in two
View
4 s/d_split.cpp
@@ -372,10 +372,10 @@ namespace mongo {
class SplitChunkCommand : public Command {
public:
- SplitChunkCommand() : Command( "splitChunk_ForDevOnly" ){}
+ SplitChunkCommand() : Command( "splitChunk" ){}
virtual void help( stringstream& help ) const {
help <<
- "internal command ** under development ** \n"
+ "internal command usage only\n"
"example:\n"
" { splitChunk:\"db.foo\" , keyPattern: {a:1} , min : {a:100} , max: {a:200} { splitKeys : [ {a:150} , ... ]}";
}
Please sign in to comment.
Something went wrong with that request. Please try again.