0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-28 07:59:02 +01:00

SERVER-17679 mergeChunks command should check if sharding state is initialized

This commit is contained in:
Kaloian Manassiev 2015-03-23 10:14:32 -04:00
parent 875b0c2c02
commit 3bcc824676

View File

@ -136,14 +136,14 @@ namespace mongo {
configField,
&config,
&errmsg );
if ( !extracted ) return false;
if ( extracted != FieldParser::FIELD_NONE ) {
ShardingState::initialize( config );
}
else if ( !shardingState.enabled() ) {
errmsg =
"sharding state must be enabled or config server specified to merge chunks";
return false;
if (!shardingState.enabled()) {
if (!extracted || extracted == FieldParser::FIELD_NONE) {
errmsg = "sharding state must be enabled or "
"config server specified to merge chunks";
return false;
}
ShardingState::initialize(config);
}
// ShardName is optional, but might not be set yet