diff options
author | Suganthi Mani <suganthi.mani@mongodb.com> | 2020-04-14 09:40:34 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-17 16:04:39 +0000 |
commit | 3b9c2f4ba4079b7dfb6f2a6f323564b798a64678 (patch) | |
tree | 4dbb17c44cf87c635a2668fe4f1c6f87d055fa9b /src/mongo | |
parent | 0ef531c6ceed95083a14601eb1a09bb6abfc90e9 (diff) | |
download | mongo-3b9c2f4ba4079b7dfb6f2a6f323564b798a64678.tar.gz |
SERVER-47461 Remove commit quorum field from StartIndexBuild oplog entry.
(cherry picked from commit 49d1262c366d439e6dd34b586c14ad64e8a764ab)
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/auth/auth_op_observer.h | 1 | ||||
-rw-r--r-- | src/mongo/db/catalog/index_build_oplog_entry.cpp | 20 | ||||
-rw-r--r-- | src/mongo/db/catalog/index_build_oplog_entry.h | 1 | ||||
-rw-r--r-- | src/mongo/db/catalog/rename_collection_test.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/cloner.cpp | 9 | ||||
-rw-r--r-- | src/mongo/db/commands/mr_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/free_mon/free_mon_op_observer.h | 1 | ||||
-rw-r--r-- | src/mongo/db/index_builds_coordinator.cpp | 9 | ||||
-rw-r--r-- | src/mongo/db/op_observer.h | 1 | ||||
-rw-r--r-- | src/mongo/db/op_observer_impl.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/op_observer_impl.h | 1 | ||||
-rw-r--r-- | src/mongo/db/op_observer_impl_test.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/op_observer_noop.h | 1 | ||||
-rw-r--r-- | src/mongo/db/op_observer_registry.h | 4 | ||||
-rw-r--r-- | src/mongo/db/repl/rs_rollback_test.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/s/config_server_op_observer.h | 1 | ||||
-rw-r--r-- | src/mongo/db/s/shard_server_op_observer.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/s/shard_server_op_observer.h | 1 |
18 files changed, 8 insertions, 61 deletions
diff --git a/src/mongo/db/auth/auth_op_observer.h b/src/mongo/db/auth/auth_op_observer.h index 96e09b4d028..47293e12e09 100644 --- a/src/mongo/db/auth/auth_op_observer.h +++ b/src/mongo/db/auth/auth_op_observer.h @@ -56,7 +56,6 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) final {} void onStartIndexBuildSinglePhase(OperationContext* opCtx, const NamespaceString& nss) final {} diff --git a/src/mongo/db/catalog/index_build_oplog_entry.cpp b/src/mongo/db/catalog/index_build_oplog_entry.cpp index b37d274be40..07d965ba64a 100644 --- a/src/mongo/db/catalog/index_build_oplog_entry.cpp +++ b/src/mongo/db/catalog/index_build_oplog_entry.cpp @@ -41,7 +41,6 @@ StatusWith<IndexBuildOplogEntry> IndexBuildOplogEntry::parse(const repl::OplogEn // { // < "startIndexBuild" | "commitIndexBuild" | "abortIndexBuild" > : "coll", // "indexBuildUUID" : <UUID>, - // "commitQuorum" : [<int>|<std::string>] // only required for 'startIndexBuild' // "indexes" : [ // { // "key" : { @@ -87,24 +86,6 @@ StatusWith<IndexBuildOplogEntry> IndexBuildOplogEntry::parse(const repl::OplogEn return swBuildUUID.getStatus().withContext("Error parsing 'indexBuildUUID'"); } - boost::optional<CommitQuorumOptions> commitQuorum; - if (repl::OplogEntry::CommandType::kStartIndexBuild == commandType) { - auto commitQuorumElem = obj.getField(CommitQuorumOptions::kCommitQuorumField); - if (commitQuorumElem.eoo()) { - return {ErrorCodes::BadValue, - str::stream() << "Missing required field '" - << CommitQuorumOptions::kCommitQuorumField << "'"}; - } - - commitQuorum = CommitQuorumOptions(); - auto status = commitQuorum->parse(commitQuorumElem); - if (!status.isOK()) { - return status.withContext(str::stream() << "Error parsing '" - << CommitQuorumOptions::kCommitQuorumField - << "': " << status.reason()); - } - } - auto indexesElem = obj.getField("indexes"); if (indexesElem.eoo()) { return {ErrorCodes::BadValue, str::stream() << "Missing required field 'indexes'"}; @@ -152,7 +133,6 @@ StatusWith<IndexBuildOplogEntry> IndexBuildOplogEntry::parse(const repl::OplogEn commandType, commandName.toString(), swBuildUUID.getValue(), - commitQuorum, indexNames, indexSpecs, cause}; diff --git a/src/mongo/db/catalog/index_build_oplog_entry.h b/src/mongo/db/catalog/index_build_oplog_entry.h index 1f0d0075965..3da9a6e03ae 100644 --- a/src/mongo/db/catalog/index_build_oplog_entry.h +++ b/src/mongo/db/catalog/index_build_oplog_entry.h @@ -49,7 +49,6 @@ public: repl::OplogEntry::CommandType commandType; std::string commandName; UUID buildUUID; - boost::optional<CommitQuorumOptions> commitQuorum; std::vector<std::string> indexNames; std::vector<BSONObj> indexSpecs; boost::optional<Status> cause; diff --git a/src/mongo/db/catalog/rename_collection_test.cpp b/src/mongo/db/catalog/rename_collection_test.cpp index 0f8965a76db..acbf3415f1c 100644 --- a/src/mongo/db/catalog/rename_collection_test.cpp +++ b/src/mongo/db/catalog/rename_collection_test.cpp @@ -85,7 +85,6 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) override; void onCommitIndexBuild(OperationContext* opCtx, @@ -180,11 +179,9 @@ void OpObserverMock::onStartIndexBuild(OperationContext* opCtx, CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) { _logOp(opCtx, nss, "startIndex"); - OpObserverNoop::onStartIndexBuild( - opCtx, nss, collUUID, indexBuildUUID, indexes, commitQuorum, fromMigrate); + OpObserverNoop::onStartIndexBuild(opCtx, nss, collUUID, indexBuildUUID, indexes, fromMigrate); } void OpObserverMock::onCommitIndexBuild(OperationContext* opCtx, diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp index 80eac846bd3..67cb52560c8 100644 --- a/src/mongo/db/cloner.cpp +++ b/src/mongo/db/cloner.cpp @@ -419,13 +419,8 @@ void Cloner::copyIndexes(OperationContext* opCtx, IndexBuildsCoordinator::extractIndexNames(specs)); uassertStatusOK(indexbuildentryhelpers::addIndexBuildEntry(opCtx, indexbuildEntry)); - opObserver->onStartIndexBuild(opCtx, - to_collection, - collection->uuid(), - *buildUUID, - specs, - CommitQuorumOptions(CommitQuorumOptions::kDisabled), - fromMigrate); + opObserver->onStartIndexBuild( + opCtx, to_collection, collection->uuid(), *buildUUID, specs, fromMigrate); return Status::OK(); }; } else { diff --git a/src/mongo/db/commands/mr_test.cpp b/src/mongo/db/commands/mr_test.cpp index 4385b99dad4..d648ee1bdc4 100644 --- a/src/mongo/db/commands/mr_test.cpp +++ b/src/mongo/db/commands/mr_test.cpp @@ -299,7 +299,6 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) override; /** @@ -355,7 +354,6 @@ void MapReduceOpObserver::onStartIndexBuild(OperationContext* opCtx, CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) { for (auto&& obj : indexes) { indexesCreated.push_back(obj.getOwned()); diff --git a/src/mongo/db/free_mon/free_mon_op_observer.h b/src/mongo/db/free_mon/free_mon_op_observer.h index eb1972bc49a..21478a822e5 100644 --- a/src/mongo/db/free_mon/free_mon_op_observer.h +++ b/src/mongo/db/free_mon/free_mon_op_observer.h @@ -56,7 +56,6 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) final {} void onStartIndexBuildSinglePhase(OperationContext* opCtx, const NamespaceString& nss) final {} diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp index b4937deb10c..8b5d785b36f 100644 --- a/src/mongo/db/index_builds_coordinator.cpp +++ b/src/mongo/db/index_builds_coordinator.cpp @@ -1353,13 +1353,7 @@ void IndexBuildsCoordinator::createIndexes(OperationContext* opCtx, extractIndexNames(specs)); uassertStatusOK(addIndexBuildEntry(opCtx, indexbuildEntry)); - opObserver->onStartIndexBuild(opCtx, - nss, - collectionUUID, - buildUUID, - specs, - CommitQuorumOptions(CommitQuorumOptions::kDisabled), - fromMigrate); + opObserver->onStartIndexBuild(opCtx, nss, collectionUUID, buildUUID, specs, fromMigrate); opObserver->onCommitIndexBuild(opCtx, nss, collectionUUID, buildUUID, specs, fromMigrate); }; uassertStatusOK(_indexBuildsManager.commitIndexBuild( @@ -1669,7 +1663,6 @@ IndexBuildsCoordinator::PostSetupAction IndexBuildsCoordinator::_setUpIndexBuild replState->collectionUUID, replState->buildUUID, replState->indexSpecs, - indexBuildEntry.getCommitQuorum(), false /* fromMigrate */); return Status::OK(); diff --git a/src/mongo/db/op_observer.h b/src/mongo/db/op_observer.h index 547007efe61..d10620418cf 100644 --- a/src/mongo/db/op_observer.h +++ b/src/mongo/db/op_observer.h @@ -100,7 +100,6 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) = 0; /** diff --git a/src/mongo/db/op_observer_impl.cpp b/src/mongo/db/op_observer_impl.cpp index 6b9ee596ba7..40802b19abf 100644 --- a/src/mongo/db/op_observer_impl.cpp +++ b/src/mongo/db/op_observer_impl.cpp @@ -273,15 +273,12 @@ void OpObserverImpl::onStartIndexBuild(OperationContext* opCtx, CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) { BSONObjBuilder oplogEntryBuilder; oplogEntryBuilder.append("startIndexBuild", nss.coll()); indexBuildUUID.appendToBuilder(&oplogEntryBuilder, "indexBuildUUID"); - commitQuorum.appendToBuilder(CommitQuorumOptions::kCommitQuorumField, &oplogEntryBuilder); - BSONArrayBuilder indexesArr(oplogEntryBuilder.subarrayStart("indexes")); for (auto indexDoc : indexes) { indexesArr.append(indexDoc); diff --git a/src/mongo/db/op_observer_impl.h b/src/mongo/db/op_observer_impl.h index 9019a253acd..51d6ebd6c99 100644 --- a/src/mongo/db/op_observer_impl.h +++ b/src/mongo/db/op_observer_impl.h @@ -52,7 +52,6 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) final; void onStartIndexBuildSinglePhase(OperationContext* opCtx, const NamespaceString& nss) final; diff --git a/src/mongo/db/op_observer_impl_test.cpp b/src/mongo/db/op_observer_impl_test.cpp index 0dd1bc6d4d5..56949f04d88 100644 --- a/src/mongo/db/op_observer_impl_test.cpp +++ b/src/mongo/db/op_observer_impl_test.cpp @@ -144,9 +144,8 @@ TEST_F(OpObserverTest, StartIndexBuildExpectedOplogEntry) { { AutoGetDb autoDb(opCtx.get(), nss.db(), MODE_X); WriteUnitOfWork wunit(opCtx.get()); - CommitQuorumOptions commitQuorum(1); opObserver.onStartIndexBuild( - opCtx.get(), nss, uuid, indexBuildUUID, specs, commitQuorum, false /*fromMigrate*/); + opCtx.get(), nss, uuid, indexBuildUUID, specs, false /*fromMigrate*/); wunit.commit(); } @@ -154,7 +153,6 @@ TEST_F(OpObserverTest, StartIndexBuildExpectedOplogEntry) { BSONObjBuilder startIndexBuildBuilder; startIndexBuildBuilder.append("startIndexBuild", nss.coll()); indexBuildUUID.appendToBuilder(&startIndexBuildBuilder, "indexBuildUUID"); - startIndexBuildBuilder.append("commitQuorum", 1); BSONArrayBuilder indexesArr(startIndexBuildBuilder.subarrayStart("indexes")); indexesArr.append(specX); indexesArr.append(specA); diff --git a/src/mongo/db/op_observer_noop.h b/src/mongo/db/op_observer_noop.h index 0a1542ea50a..5c5816e7c0b 100644 --- a/src/mongo/db/op_observer_noop.h +++ b/src/mongo/db/op_observer_noop.h @@ -46,7 +46,6 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) override {} void onStartIndexBuildSinglePhase(OperationContext* opCtx, diff --git a/src/mongo/db/op_observer_registry.h b/src/mongo/db/op_observer_registry.h index ec7fe1908c1..2470baa74cc 100644 --- a/src/mongo/db/op_observer_registry.h +++ b/src/mongo/db/op_observer_registry.h @@ -73,12 +73,10 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) override { ReservedTimes times{opCtx}; for (auto& o : _observers) { - o->onStartIndexBuild( - opCtx, nss, collUUID, indexBuildUUID, indexes, commitQuorum, fromMigrate); + o->onStartIndexBuild(opCtx, nss, collUUID, indexBuildUUID, indexes, fromMigrate); } } diff --git a/src/mongo/db/repl/rs_rollback_test.cpp b/src/mongo/db/repl/rs_rollback_test.cpp index 63898eab024..37891891cd0 100644 --- a/src/mongo/db/repl/rs_rollback_test.cpp +++ b/src/mongo/db/repl/rs_rollback_test.cpp @@ -101,7 +101,7 @@ OplogInterfaceMock::Operation makeStartIndexBuildOplogEntry(Collection* collecti BSONObj spec, int time) { auto entry = BSON("startIndexBuild" << collection->ns().coll() << "indexBuildUUID" << buildUUID - << "indexes" << BSON_ARRAY(spec) << "commitQuorum" << 1); + << "indexes" << BSON_ARRAY(spec)); return std::make_pair(BSON("ts" << Timestamp(Seconds(time), 0) << "op" << "c" @@ -2899,4 +2899,4 @@ TEST_F(RSRollbackTest, RollbackInvalidatesDefaultRWConcernCache) { } } // namespace -} // namespace mongo
\ No newline at end of file +} // namespace mongo diff --git a/src/mongo/db/s/config_server_op_observer.h b/src/mongo/db/s/config_server_op_observer.h index 40b24d10bd6..d274dfef21a 100644 --- a/src/mongo/db/s/config_server_op_observer.h +++ b/src/mongo/db/s/config_server_op_observer.h @@ -56,7 +56,6 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) override {} void onStartIndexBuildSinglePhase(OperationContext* opCtx, diff --git a/src/mongo/db/s/shard_server_op_observer.cpp b/src/mongo/db/s/shard_server_op_observer.cpp index 0fb63ddf362..6832dd1bc0e 100644 --- a/src/mongo/db/s/shard_server_op_observer.cpp +++ b/src/mongo/db/s/shard_server_op_observer.cpp @@ -495,7 +495,6 @@ void ShardServerOpObserver::onStartIndexBuild(OperationContext* opCtx, CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) { abortOngoingMigrationIfNeeded(opCtx, nss); }; diff --git a/src/mongo/db/s/shard_server_op_observer.h b/src/mongo/db/s/shard_server_op_observer.h index f3e659b437d..2b16ac88150 100644 --- a/src/mongo/db/s/shard_server_op_observer.h +++ b/src/mongo/db/s/shard_server_op_observer.h @@ -57,7 +57,6 @@ public: CollectionUUID collUUID, const UUID& indexBuildUUID, const std::vector<BSONObj>& indexes, - const CommitQuorumOptions& commitQuorum, bool fromMigrate) override; void onStartIndexBuildSinglePhase(OperationContext* opCtx, const NamespaceString& nss) override; |