diff options
| author | Spencer T Brody <spencer@mongodb.com> | 2016-09-06 12:52:00 -0400 |
|---|---|---|
| committer | Spencer T Brody <spencer@mongodb.com> | 2016-09-08 13:19:05 -0400 |
| commit | cb08672b2e759f4a63a114a171e009ea95925fca (patch) | |
| tree | ccd20d72d8d317bb536f9217d6c561a6d55959f0 /src | |
| parent | 6c2169cc938d4ef1797782be934e6ce7c97fc21a (diff) | |
| download | mongo-cb08672b2e759f4a63a114a171e009ea95925fca.tar.gz | |
SERVER-25856 Rename _configsvr{Split,Merge}Chunks commands to _configsvrCommitChunk{Split,Merge}
Diffstat (limited to 'src')
10 files changed, 66 insertions, 64 deletions
diff --git a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp index f947bc01869..8988a5e4e4e 100644 --- a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp @@ -52,7 +52,7 @@ using std::string; * * Format: * { - * _configsvrMergeChunk: <string namespace>, + * _configsvrCommitChunkMerge: <string namespace>, * collEpoch: <OID epoch>, * chunkBoundaries: [ * <BSONObj key1>, @@ -65,7 +65,7 @@ using std::string; */ class ConfigSvrMergeChunkCommand : public Command { public: - ConfigSvrMergeChunkCommand() : Command("_configsvrMergeChunk") {} + ConfigSvrMergeChunkCommand() : Command("_configsvrCommitChunkMerge") {} void help(std::stringstream& help) const override { help << "Internal command, which is sent by a shard to the sharding config server. Do " @@ -106,7 +106,7 @@ public: BSONObjBuilder& result) override { if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) { uasserted(ErrorCodes::IllegalOperation, - "_configsvrMergeChunk can only be run on config servers"); + "_configsvrCommitChunkMerge can only be run on config servers"); } auto parsedRequest = uassertStatusOK(MergeChunkRequest::parseFromConfigCommand(cmdObj)); diff --git a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp index 92085bd0db7..a8744987929 100644 --- a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp @@ -52,7 +52,7 @@ using std::string; * * Format: * { - * _configsvrSplitChunk: <string namespace>, + * _configsvrCommitChunkSplit: <string namespace>, * collEpoch: <OID epoch>, * min: <BSONObj chunkToSplitMin>, * max: <BSONObj chunkToSplitMax>, @@ -63,7 +63,7 @@ using std::string; */ class ConfigSvrSplitChunkCommand : public Command { public: - ConfigSvrSplitChunkCommand() : Command("_configsvrSplitChunk") {} + ConfigSvrSplitChunkCommand() : Command("_configsvrCommitChunkSplit") {} void help(std::stringstream& help) const override { help << "Internal command, which is sent by a shard to the sharding config server. Do " @@ -104,7 +104,7 @@ public: BSONObjBuilder& result) override { if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) { uasserted(ErrorCodes::IllegalOperation, - "_configsvrSplitChunk can only be run on config servers"); + "_configsvrCommitChunkSplit can only be run on config servers"); } auto parsedRequest = uassertStatusOK(SplitChunkRequest::parseFromConfigCommand(cmdObj)); diff --git a/src/mongo/db/s/merge_chunks_command.cpp b/src/mongo/db/s/merge_chunks_command.cpp index 10b11597e47..6aa427c7578 100644 --- a/src/mongo/db/s/merge_chunks_command.cpp +++ b/src/mongo/db/s/merge_chunks_command.cpp @@ -263,7 +263,7 @@ Status mergeChunks(OperationContext* txn, } // - // Run _configsvrMergeChunks. + // Run _configsvrCommitChunkMerge. // MergeChunkRequest request{ nss, shardingState->getShardName(), shardVersion.epoch(), chunkBoundaries}; @@ -279,7 +279,7 @@ Status mergeChunks(OperationContext* txn, // // Refresh metadata to pick up new chunk definitions (regardless of the results returned from - // running _configsvrMergeChunk). + // running _configsvrCommitChunkMerge). // { ChunkVersion shardVersionAfterMerge; @@ -301,10 +301,10 @@ Status mergeChunks(OperationContext* txn, return cmdResponseStatus.getStatus(); } - // If _configsvrMergeChunk returned an error, look at this shard's metadata to determine if - // the merge actually did happen. This can happen if there's a network error getting the - // response from the first call to _configsvrMergeChunk, but it actually succeeds, thus the - // automatic retry fails with a precondition violation, for example. + // If _configsvrCommitChunkMerge returned an error, look at this shard's metadata to determine + // if the merge actually did happen. This can happen if there's a network error getting the + // response from the first call to _configsvrCommitChunkMerge, but it actually succeeds, thus + // the automatic retry fails with a precondition violation, for example. auto commandStatus = std::move(cmdResponseStatus.getValue().commandStatus); auto writeConcernStatus = std::move(cmdResponseStatus.getValue().writeConcernStatus); diff --git a/src/mongo/db/s/split_chunk_command.cpp b/src/mongo/db/s/split_chunk_command.cpp index 74a437a5dbd..5b3f225d205 100644 --- a/src/mongo/db/s/split_chunk_command.cpp +++ b/src/mongo/db/s/split_chunk_command.cpp @@ -402,10 +402,10 @@ public: } // - // If _configsvrSplitChunk returned an error, look at this shard's metadata to determine if - // the split actually did happen. This can happen if there's a network error getting the - // response from the first call to _configsvrSplitChunk, but it actually succeeds, thus the - // automatic retry fails with a precondition violation, for example. + // If _configsvrCommitChunkSplit returned an error, look at this shard's metadata to + // determine if the split actually did happen. This can happen if there's a network error + // getting the response from the first call to _configsvrCommitChunkSplit, but it actually + // succeeds, thus the automatic retry fails with a precondition violation, for example. // if ((!commandStatus.isOK() || !writeConcernStatus.isOK()) && _checkMetadataForSuccess(txn, nss, chunkRange, splitKeys)) { diff --git a/src/mongo/s/request_types/merge_chunk_request_test.cpp b/src/mongo/s/request_types/merge_chunk_request_test.cpp index 094b7725707..ffb6dd54778 100644 --- a/src/mongo/s/request_types/merge_chunk_request_test.cpp +++ b/src/mongo/s/request_types/merge_chunk_request_test.cpp @@ -41,7 +41,7 @@ using unittest::assertGet; TEST(MergeChunkRequest, BasicValidConfigCommand) { auto request = assertGet(MergeChunkRequest::parseFromConfigCommand( - BSON("_configsvrMergeChunk" + BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -59,7 +59,7 @@ TEST(MergeChunkRequest, BasicValidConfigCommand) { TEST(MergeChunkRequest, ConfigCommandtoBSON) { BSONObj serializedRequest = - BSON("_configsvrMergeChunk" + BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -93,7 +93,7 @@ TEST(MergeChunkRequest, MissingNameSpaceErrors) { TEST(MergeChunkRequest, MissingCollEpochErrors) { auto request = MergeChunkRequest::parseFromConfigCommand( - BSON("_configsvrMergeChunk" + BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "chunkBoundaries" << BSON_ARRAY(BSON("a" << 1) << BSON("a" << 5) << BSON("a" << 10)) @@ -103,7 +103,7 @@ TEST(MergeChunkRequest, MissingCollEpochErrors) { } TEST(MergeChunkRequest, MissingChunkBoundariesErrors) { - auto request = MergeChunkRequest::parseFromConfigCommand(BSON("_configsvrMergeChunk" + auto request = MergeChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -114,7 +114,7 @@ TEST(MergeChunkRequest, MissingChunkBoundariesErrors) { TEST(MergeChunkRequest, MissingShardNameErrors) { auto request = MergeChunkRequest::parseFromConfigCommand( - BSON("_configsvrMergeChunk" + BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -124,18 +124,19 @@ TEST(MergeChunkRequest, MissingShardNameErrors) { } TEST(MergeChunkRequest, WrongNamespaceTypeErrors) { - auto request = MergeChunkRequest::parseFromConfigCommand(BSON( - "_configsvrMergeChunk" << 1234 << "collEpoch" << OID("7fffffff0000000000000001") - << "chunkBoundaries" - << BSON_ARRAY(BSON("a" << 1) << BSON("a" << 5) << BSON("a" << 10)) - << "shard" - << "shard0000")); + auto request = MergeChunkRequest::parseFromConfigCommand( + BSON("_configsvrCommitChunkMerge" << 1234 << "collEpoch" << OID("7fffffff0000000000000001") + << "chunkBoundaries" + << BSON_ARRAY(BSON("a" << 1) << BSON("a" << 5) + << BSON("a" << 10)) + << "shard" + << "shard0000")); ASSERT_EQ(ErrorCodes::TypeMismatch, request.getStatus()); } TEST(MergeChunkRequest, WrongCollEpochTypeErrors) { auto request = MergeChunkRequest::parseFromConfigCommand( - BSON("_configsvrMergeChunk" + BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "collEpoch" << 1234 @@ -147,7 +148,7 @@ TEST(MergeChunkRequest, WrongCollEpochTypeErrors) { } TEST(MergeChunkRequest, WrongChunkBoundariesTypeErrors) { - auto request = MergeChunkRequest::parseFromConfigCommand(BSON("_configsvrMergeChunk" + auto request = MergeChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -160,7 +161,7 @@ TEST(MergeChunkRequest, WrongChunkBoundariesTypeErrors) { TEST(MergeChunkRequest, WrongShardNameTypeErrors) { auto request = MergeChunkRequest::parseFromConfigCommand( - BSON("_configsvrMergeChunk" + BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -173,7 +174,7 @@ TEST(MergeChunkRequest, WrongShardNameTypeErrors) { TEST(MergeChunkRequest, InvalidNamespaceErrors) { auto request = MergeChunkRequest::parseFromConfigCommand( - BSON("_configsvrMergeChunk" + BSON("_configsvrCommitChunkMerge" << "" << "collEpoch" << OID("7fffffff0000000000000001") @@ -185,7 +186,7 @@ TEST(MergeChunkRequest, InvalidNamespaceErrors) { } TEST(MergeChunkRequest, EmptyChunkBoundariesErrors) { - auto request = MergeChunkRequest::parseFromConfigCommand(BSON("_configsvrMergeChunk" + auto request = MergeChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -198,7 +199,7 @@ TEST(MergeChunkRequest, EmptyChunkBoundariesErrors) { TEST(MergeChunkRequest, TooFewChunkBoundariesErrors) { auto request = MergeChunkRequest::parseFromConfigCommand( - BSON("_configsvrMergeChunk" + BSON("_configsvrCommitChunkMerge" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") diff --git a/src/mongo/s/request_types/merge_chunk_request_type.cpp b/src/mongo/s/request_types/merge_chunk_request_type.cpp index 103c5087368..6848b186cf0 100644 --- a/src/mongo/s/request_types/merge_chunk_request_type.cpp +++ b/src/mongo/s/request_types/merge_chunk_request_type.cpp @@ -40,7 +40,7 @@ using std::vector; namespace { -const char kConfigsvrMergeChunk[] = "_configsvrMergeChunk"; +const char kConfigsvrMergeChunk[] = "_configsvrCommitChunkMerge"; const char kCollEpoch[] = "collEpoch"; const char kChunkBoundaries[] = "chunkBoundaries"; const char kShardName[] = "shard"; diff --git a/src/mongo/s/request_types/merge_chunk_request_type.h b/src/mongo/s/request_types/merge_chunk_request_type.h index 31cc6e69b19..b56ea0ab501 100644 --- a/src/mongo/s/request_types/merge_chunk_request_type.h +++ b/src/mongo/s/request_types/merge_chunk_request_type.h @@ -49,11 +49,11 @@ public: std::vector<BSONObj> chunkBoundaries); /** - * Parses the provided BSON content as the internal _configsvrMergeChunk command, and if + * Parses the provided BSON content as the internal _configsvrCommitChunkMerge command, and if * it contains the correct types, constructs a MergeChunkRequest object from it. * * { - * _configsvrMergeChunk: <NamespaceString nss>, + * _configsvrCommitChunkMerge: <NamespaceString nss>, * collEpoch: <OID epoch>, * chunkBoundaries: [ * <BSONObj key1>, @@ -73,7 +73,7 @@ public: BSONObj toConfigCommandBSON(const BSONObj& writeConcern); /** - * Creates a serialized BSONObj of the internal _configsvrMergeChunk command from this + * Creates a serialized BSONObj of the internal _configsvCommitChunkMerge command from this * MergeChunkRequest instance. */ void appendAsConfigCommand(BSONObjBuilder* cmdBuilder); diff --git a/src/mongo/s/request_types/split_chunk_request_test.cpp b/src/mongo/s/request_types/split_chunk_request_test.cpp index deb5718c2bf..bd5a128175c 100644 --- a/src/mongo/s/request_types/split_chunk_request_test.cpp +++ b/src/mongo/s/request_types/split_chunk_request_test.cpp @@ -41,7 +41,7 @@ using unittest::assertGet; TEST(SplitChunkRequest, BasicValidConfigCommand) { auto request = - assertGet(SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + assertGet(SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -62,7 +62,7 @@ TEST(SplitChunkRequest, BasicValidConfigCommand) { TEST(SplitChunkRequest, ValidWithMultipleSplits) { auto request = assertGet(SplitChunkRequest::parseFromConfigCommand( - BSON("_configsvrSplitChunk" + BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -83,7 +83,7 @@ TEST(SplitChunkRequest, ValidWithMultipleSplits) { } TEST(SplitChunkRequest, ConfigCommandtoBSON) { - BSONObj serializedRequest = BSON("_configsvrSplitChunk" + BSONObj serializedRequest = BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -122,7 +122,7 @@ TEST(SplitChunkRequest, MissingNamespaceErrors) { } TEST(SplitChunkRequest, MissingCollEpochErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "min" << BSON("a" << 1) @@ -136,7 +136,7 @@ TEST(SplitChunkRequest, MissingCollEpochErrors) { } TEST(SplitChunkRequest, MissingChunkToSplitErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -150,7 +150,7 @@ TEST(SplitChunkRequest, MissingChunkToSplitErrors) { } TEST(SplitChunkRequest, MissingSplitPointErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -164,7 +164,7 @@ TEST(SplitChunkRequest, MissingSplitPointErrors) { } TEST(SplitChunkRequest, MissingShardNameErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -178,20 +178,21 @@ TEST(SplitChunkRequest, MissingShardNameErrors) { } TEST(SplitChunkRequest, WrongNamespaceTypeErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON( - "_configsvrSplitChunk" << 1234 << "collEpoch" << OID("7fffffff0000000000000001") << "min" - << BSON("a" << 1) - << "max" - << BSON("a" << 10) - << "splitPoints" - << BSON_ARRAY(BSON("a" << 5)) - << "shard" - << "shard0000")); + auto request = SplitChunkRequest::parseFromConfigCommand( + BSON("_configsvrCommitChunkSplit" << 1234 << "collEpoch" << OID("7fffffff0000000000000001") + << "min" + << BSON("a" << 1) + << "max" + << BSON("a" << 10) + << "splitPoints" + << BSON_ARRAY(BSON("a" << 5)) + << "shard" + << "shard0000")); ASSERT_EQ(ErrorCodes::TypeMismatch, request.getStatus()); } TEST(SplitChunkRequest, WrongCollEpochTypeErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << 1234 @@ -207,7 +208,7 @@ TEST(SplitChunkRequest, WrongCollEpochTypeErrors) { } TEST(SplitChunkRequest, WrongChunkToSplitTypeErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -223,7 +224,7 @@ TEST(SplitChunkRequest, WrongChunkToSplitTypeErrors) { } TEST(SplitChunkRequest, WrongSplitPointTypeErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -239,7 +240,7 @@ TEST(SplitChunkRequest, WrongSplitPointTypeErrors) { } TEST(SplitChunkRequest, WrongShardNameTypeErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -255,7 +256,7 @@ TEST(SplitChunkRequest, WrongShardNameTypeErrors) { } TEST(SplitChunkRequest, InvalidNamespaceErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "" << "collEpoch" << OID("7fffffff0000000000000001") @@ -271,7 +272,7 @@ TEST(SplitChunkRequest, InvalidNamespaceErrors) { } TEST(SplitChunkRequest, EmptyChunkToSplitErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") @@ -287,7 +288,7 @@ TEST(SplitChunkRequest, EmptyChunkToSplitErrors) { } TEST(SplitChunkRequest, EmptySplitPointsErrors) { - auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrSplitChunk" + auto request = SplitChunkRequest::parseFromConfigCommand(BSON("_configsvrCommitChunkSplit" << "TestDB.TestColl" << "collEpoch" << OID("7fffffff0000000000000001") diff --git a/src/mongo/s/request_types/split_chunk_request_type.cpp b/src/mongo/s/request_types/split_chunk_request_type.cpp index a3ca50c7f32..830da796c16 100644 --- a/src/mongo/s/request_types/split_chunk_request_type.cpp +++ b/src/mongo/s/request_types/split_chunk_request_type.cpp @@ -40,7 +40,7 @@ using std::vector; namespace { -const char kConfigsvrSplitChunk[] = "_configsvrSplitChunk"; +const char kConfigsvrSplitChunk[] = "_configsvrCommitChunkSplit"; const char kCollEpoch[] = "collEpoch"; const char kSplitPoints[] = "splitPoints"; const char kShardName[] = "shard"; diff --git a/src/mongo/s/request_types/split_chunk_request_type.h b/src/mongo/s/request_types/split_chunk_request_type.h index f8fd4972a9d..ba425294ad1 100644 --- a/src/mongo/s/request_types/split_chunk_request_type.h +++ b/src/mongo/s/request_types/split_chunk_request_type.h @@ -51,11 +51,11 @@ public: std::vector<BSONObj> splitPoints); /** - * Parses the provided BSON content as the internal _configsvrSplitChunk command, and if + * Parses the provided BSON content as the internal _configsvrCommitChunkSplit command, and if * it contains the correct types, constructs a SplitChunkRequest object from it. * * { - * _configsvrSplitChunk: <NamespaceString nss>, + * _configsvrCommitChunkSplit: <NamespaceString nss>, * collEpoch: <OID epoch>, * min: <BSONObj chunkToSplitMin>, * max: <BSONObj chunkToSplitMax>, @@ -73,7 +73,7 @@ public: BSONObj toConfigCommandBSON(const BSONObj& writeConcern); /** - * Creates a serialized BSONObj of the internal _configsvrSplitChunk command from this + * Creates a serialized BSONObj of the internal _configsvrCommitChunkSplit command from this * SplitChunkRequest instance. */ void appendAsConfigCommand(BSONObjBuilder* cmdBuilder); |
