Skip to content

Commit

Permalink
Balance out chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mainak Ghosh committed Mar 15, 2014
1 parent 28b5eb4 commit 9f54cff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mongo/s/commands_admin.cpp
Expand Up @@ -996,8 +996,8 @@ namespace mongo {
log() << "[MYCODE_TIME] rowCount: " << rowCount << endl;

long long maxObjectPerChunk = rowCount / numChunk;
if (maxObjectPerChunk > Chunk::MaxObjectPerChunk)
maxObjectPerChunk = Chunk::MaxObjectPerChunk;
//if (maxObjectPerChunk > Chunk::MaxObjectPerChunk)
// maxObjectPerChunk = Chunk::MaxObjectPerChunk;

pickSplitVector(splitPoints, ns, proposedKey, proposedShardKey.globalMin(), proposedShardKey.globalMax(), Chunk::MaxChunkSize, numChunk - 1, maxObjectPerChunk);

Expand Down
3 changes: 2 additions & 1 deletion src/mongo/s/server.cpp
Expand Up @@ -109,7 +109,7 @@ namespace mongo {
r.process();
}
catch ( AssertionException & e ) {
log() << "[MYCODE] User Exception 5" << endl;
log() << "[MYCODE] User Exception 5:" << e.what() << endl;
LOG( e.isUserAssertion() ? 1 : 0 ) << "AssertionException while processing op type : " << m.operation() << " to : " << r.getns() << causedBy(e) << endl;

le->raiseError( e.getCode() , e.what() );
Expand All @@ -126,6 +126,7 @@ namespace mongo {
// e.what(). we should think about what is the right level of detail both
// for logging and return code.
log() << "DBException in process: " << e.what() << endl;
log() << "[MYCODE] User Exception 5:" << e.what() << endl;

le->raiseError( e.getCode() , e.what() );

Expand Down

0 comments on commit 9f54cff

Please sign in to comment.