diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2021-10-14 15:38:43 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-15 17:11:13 +0000 |
commit | e9a8bc753f79abff3aec1eff945ca2ea7f3fd311 (patch) | |
tree | f943193095637c94051968f5b90322447d46af9e /src/mongo/db | |
parent | 2bf37b1ac522b39e186388ea382a5a14c0636da6 (diff) | |
download | mongo-e9a8bc753f79abff3aec1eff945ca2ea7f3fd311.tar.gz |
SERVER-31540 Get rid of boost::optional<UUID> from the OpObservers
Diffstat (limited to 'src/mongo/db')
31 files changed, 90 insertions, 89 deletions
diff --git a/src/mongo/db/auth/auth_op_observer.cpp b/src/mongo/db/auth/auth_op_observer.cpp index c05983b875c..490f8303f4a 100644 --- a/src/mongo/db/auth/auth_op_observer.cpp +++ b/src/mongo/db/auth/auth_op_observer.cpp @@ -52,7 +52,7 @@ AuthOpObserver::~AuthOpObserver() = default; void AuthOpObserver::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator first, std::vector<InsertStatement>::const_iterator last, bool fromMigrate) { @@ -86,7 +86,7 @@ void AuthOpObserver::aboutToDelete(OperationContext* opCtx, void AuthOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { auto& documentId = documentIdDecoration(opCtx); diff --git a/src/mongo/db/auth/auth_op_observer.h b/src/mongo/db/auth/auth_op_observer.h index 811c7fe211f..970811d934d 100644 --- a/src/mongo/db/auth/auth_op_observer.h +++ b/src/mongo/db/auth/auth_op_observer.h @@ -79,7 +79,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator first, std::vector<InsertStatement>::const_iterator last, bool fromMigrate) final; @@ -92,7 +92,7 @@ public: void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) final; diff --git a/src/mongo/db/auth/auth_op_observer_test.cpp b/src/mongo/db/auth/auth_op_observer_test.cpp index 527b465f37d..be5c426aafe 100644 --- a/src/mongo/db/auth/auth_op_observer_test.cpp +++ b/src/mongo/db/auth/auth_op_observer_test.cpp @@ -144,7 +144,7 @@ DEATH_TEST_F(AuthOpObserverTest, AboutToDeleteMustPreceedOnDelete, "invariant") auto opCtx = cc().makeOperationContext(); cc().swapLockState(std::make_unique<LockerNoop>()); NamespaceString nss = {"test", "coll"}; - opObserver.onDelete(opCtx.get(), nss, {}, {}, {}); + opObserver.onDelete(opCtx.get(), nss, UUID::gen(), {}, {}); } DEATH_TEST_F(AuthOpObserverTest, EachOnDeleteRequiresAboutToDelete, "invariant") { @@ -153,8 +153,8 @@ DEATH_TEST_F(AuthOpObserverTest, EachOnDeleteRequiresAboutToDelete, "invariant") cc().swapLockState(std::make_unique<LockerNoop>()); NamespaceString nss = {"test", "coll"}; opObserver.aboutToDelete(opCtx.get(), nss, {}); - opObserver.onDelete(opCtx.get(), nss, {}, {}, {}); - opObserver.onDelete(opCtx.get(), nss, {}, {}, {}); + opObserver.onDelete(opCtx.get(), nss, UUID::gen(), {}, {}); + opObserver.onDelete(opCtx.get(), nss, UUID::gen(), {}, {}); } } // namespace diff --git a/src/mongo/db/catalog/collection_impl.cpp b/src/mongo/db/catalog/collection_impl.cpp index 8955365a55a..1b4ce009afc 100644 --- a/src/mongo/db/catalog/collection_impl.cpp +++ b/src/mongo/db/catalog/collection_impl.cpp @@ -806,7 +806,7 @@ Status CollectionImpl::insertDocumentForBulkLoader( } inserts.emplace_back(kUninitializedStmtId, doc, slot); - getGlobalServiceContext()->getOpObserver()->onInserts( + opCtx->getServiceContext()->getOpObserver()->onInserts( opCtx, ns(), uuid(), inserts.begin(), inserts.end(), false); _cappedDeleteAsNeeded(opCtx, loc.getValue()); diff --git a/src/mongo/db/catalog/rename_collection_test.cpp b/src/mongo/db/catalog/rename_collection_test.cpp index 39bb83b448e..aac39bbb2b8 100644 --- a/src/mongo/db/catalog/rename_collection_test.cpp +++ b/src/mongo/db/catalog/rename_collection_test.cpp @@ -103,7 +103,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) override; @@ -210,7 +210,7 @@ void OpObserverMock::onAbortIndexBuild(OperationContext* opCtx, void OpObserverMock::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) { diff --git a/src/mongo/db/commands/mr_test.cpp b/src/mongo/db/commands/mr_test.cpp index 9c0854ace43..02c9fb7d3a5 100644 --- a/src/mongo/db/commands/mr_test.cpp +++ b/src/mongo/db/commands/mr_test.cpp @@ -262,7 +262,7 @@ public: */ void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) override; @@ -318,7 +318,7 @@ void MapReduceOpObserver::onStartIndexBuild(OperationContext* opCtx, void MapReduceOpObserver::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) { diff --git a/src/mongo/db/fcv_op_observer.cpp b/src/mongo/db/fcv_op_observer.cpp index 76f9c86692d..dec9c2eb62b 100644 --- a/src/mongo/db/fcv_op_observer.cpp +++ b/src/mongo/db/fcv_op_observer.cpp @@ -149,7 +149,7 @@ void FcvOpObserver::_onInsertOrUpdate(OperationContext* opCtx, const BSONObj& do void FcvOpObserver::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator first, std::vector<InsertStatement>::const_iterator last, bool fromMigrate) { @@ -171,7 +171,7 @@ void FcvOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs void FcvOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { // documentKeyDecoration is set in OpObserverImpl::aboutToDelete. So the FcvOpObserver diff --git a/src/mongo/db/fcv_op_observer.h b/src/mongo/db/fcv_op_observer.h index 0490023ec05..a13a42bdf0d 100644 --- a/src/mongo/db/fcv_op_observer.h +++ b/src/mongo/db/fcv_op_observer.h @@ -52,7 +52,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator first, std::vector<InsertStatement>::const_iterator last, bool fromMigrate) final; @@ -61,7 +61,7 @@ public: void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) final; diff --git a/src/mongo/db/free_mon/free_mon_op_observer.cpp b/src/mongo/db/free_mon/free_mon_op_observer.cpp index 73861cc31d9..72eb9aa5d68 100644 --- a/src/mongo/db/free_mon/free_mon_op_observer.cpp +++ b/src/mongo/db/free_mon/free_mon_op_observer.cpp @@ -73,7 +73,7 @@ repl::OpTime FreeMonOpObserver::onDropCollection(OperationContext* opCtx, void FreeMonOpObserver::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) { @@ -132,7 +132,7 @@ void FreeMonOpObserver::aboutToDelete(OperationContext* opCtx, void FreeMonOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { if (nss != NamespaceString::kServerConfigurationNamespace) { 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 8c985f0f58e..4a32e5df81c 100644 --- a/src/mongo/db/free_mon/free_mon_op_observer.h +++ b/src/mongo/db/free_mon/free_mon_op_observer.h @@ -79,7 +79,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) final; @@ -92,7 +92,7 @@ public: void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) final; diff --git a/src/mongo/db/op_observer.h b/src/mongo/db/op_observer.h index ba8313cdba9..751fb247be0 100644 --- a/src/mongo/db/op_observer.h +++ b/src/mongo/db/op_observer.h @@ -141,7 +141,7 @@ public: virtual void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) = 0; @@ -179,7 +179,7 @@ public: */ virtual void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) = 0; diff --git a/src/mongo/db/op_observer_impl.cpp b/src/mongo/db/op_observer_impl.cpp index d422e050de8..5099430ac9a 100644 --- a/src/mongo/db/op_observer_impl.cpp +++ b/src/mongo/db/op_observer_impl.cpp @@ -519,7 +519,7 @@ void OpObserverImpl::onAbortIndexBuild(OperationContext* opCtx, void OpObserverImpl::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator first, std::vector<InsertStatement>::const_iterator last, bool fromMigrate) { @@ -544,7 +544,7 @@ void OpObserverImpl::onInserts(OperationContext* opCtx, } for (auto iter = first; iter != last; iter++) { - auto operation = MutableOplogEntry::makeInsertOperation(nss, uuid.get(), iter->doc); + auto operation = MutableOplogEntry::makeInsertOperation(nss, uuid, iter->doc); operation.setDestinedRecipient( shardingWriteRouter.getReshardingDestinedRecipient(iter->doc)); txnParticipant.addTransactionOperation(opCtx, operation); @@ -771,7 +771,7 @@ void OpObserverImpl::aboutToDelete(OperationContext* opCtx, void OpObserverImpl::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { auto optDocKey = documentKeyDecoration(opCtx); @@ -789,7 +789,7 @@ void OpObserverImpl::onDelete(OperationContext* opCtx, "Attempted a retryable write within a multi-document transaction", args.retryableWritePreImageRecordingType == RetryableOptions::kNotRetryable); auto operation = - MutableOplogEntry::makeDeleteOperation(nss, uuid.get(), documentKey.getShardKeyAndId()); + MutableOplogEntry::makeDeleteOperation(nss, uuid, documentKey.getShardKeyAndId()); if (args.preImageRecordingEnabledForCollection) { tassert(5868701, @@ -837,9 +837,9 @@ void OpObserverImpl::onDelete(OperationContext* opCtx, // and not performing an initial sync or a tenant migration. if (opCtx->isEnforcingConstraints() && args.changeStreamPreAndPostImagesEnabledForCollection) { - tassert(5868704, "Deleted document and uuid must be set", args.deletedDoc && uuid); + tassert(5868704, "Deleted document must be set", args.deletedDoc); - ChangeStreamPreImageId id(uuid.get(), opTime.writeOpTime.getTimestamp(), 0); + ChangeStreamPreImageId id(uuid, opTime.writeOpTime.getTimestamp(), 0); ChangeStreamPreImage preImage(id, opTime.wallClockTime, *args.deletedDoc); writeToChangeStreamPreImagesCollection(opCtx, preImage); } diff --git a/src/mongo/db/op_observer_impl.h b/src/mongo/db/op_observer_impl.h index dc3f948d640..f77778fb049 100644 --- a/src/mongo/db/op_observer_impl.h +++ b/src/mongo/db/op_observer_impl.h @@ -97,7 +97,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) final; @@ -107,7 +107,7 @@ public: const BSONObj& doc) final; void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) final; void onInternalOpMessage(OperationContext* opCtx, diff --git a/src/mongo/db/op_observer_impl_test.cpp b/src/mongo/db/op_observer_impl_test.cpp index 312b1e664cb..6829eca51b2 100644 --- a/src/mongo/db/op_observer_impl_test.cpp +++ b/src/mongo/db/op_observer_impl_test.cpp @@ -693,7 +693,7 @@ DEATH_TEST_F(OpObserverTest, AboutToDeleteMustPreceedOnDelete, "invariant") { auto opCtx = cc().makeOperationContext(); cc().swapLockState(std::make_unique<LockerNoop>()); NamespaceString nss = {"test", "coll"}; - opObserver.onDelete(opCtx.get(), nss, {}, kUninitializedStmtId, {}); + opObserver.onDelete(opCtx.get(), nss, UUID::gen(), kUninitializedStmtId, {}); } DEATH_TEST_F(OpObserverTest, EachOnDeleteRequiresAboutToDelete, "invariant") { @@ -701,9 +701,10 @@ DEATH_TEST_F(OpObserverTest, EachOnDeleteRequiresAboutToDelete, "invariant") { auto opCtx = cc().makeOperationContext(); cc().swapLockState(std::make_unique<LockerNoop>()); NamespaceString nss = {"test", "coll"}; + UUID uuid = UUID::gen(); opObserver.aboutToDelete(opCtx.get(), nss, {}); - opObserver.onDelete(opCtx.get(), nss, {}, kUninitializedStmtId, {}); - opObserver.onDelete(opCtx.get(), nss, {}, kUninitializedStmtId, {}); + opObserver.onDelete(opCtx.get(), nss, uuid, kUninitializedStmtId, {}); + opObserver.onDelete(opCtx.get(), nss, uuid, kUninitializedStmtId, {}); } DEATH_TEST_REGEX_F(OpObserverTest, diff --git a/src/mongo/db/op_observer_noop.h b/src/mongo/db/op_observer_noop.h index 8c859c7a03b..316d528cb60 100644 --- a/src/mongo/db/op_observer_noop.h +++ b/src/mongo/db/op_observer_noop.h @@ -71,7 +71,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) override {} @@ -81,7 +81,7 @@ public: const BSONObj& doc) override {} void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) override {} void onInternalOpMessage(OperationContext* opCtx, diff --git a/src/mongo/db/op_observer_registry.h b/src/mongo/db/op_observer_registry.h index afb039743c4..c7c207e8832 100644 --- a/src/mongo/db/op_observer_registry.h +++ b/src/mongo/db/op_observer_registry.h @@ -68,53 +68,53 @@ public: o->onCreateIndex(opCtx, nss, uuid, indexDoc, fromMigrate); } - virtual void onStartIndexBuild(OperationContext* opCtx, - const NamespaceString& nss, - CollectionUUID collUUID, - const UUID& indexBuildUUID, - const std::vector<BSONObj>& indexes, - bool fromMigrate) override { + void onStartIndexBuild(OperationContext* opCtx, + const NamespaceString& nss, + CollectionUUID collUUID, + const UUID& indexBuildUUID, + const std::vector<BSONObj>& indexes, + bool fromMigrate) override { ReservedTimes times{opCtx}; for (auto& o : _observers) { o->onStartIndexBuild(opCtx, nss, collUUID, indexBuildUUID, indexes, fromMigrate); } } - virtual void onStartIndexBuildSinglePhase(OperationContext* opCtx, - const NamespaceString& nss) override { + void onStartIndexBuildSinglePhase(OperationContext* opCtx, + const NamespaceString& nss) override { ReservedTimes times{opCtx}; for (auto& o : _observers) { o->onStartIndexBuildSinglePhase(opCtx, nss); } } - virtual void onAbortIndexBuildSinglePhase(OperationContext* opCtx, - const NamespaceString& nss) override { + void onAbortIndexBuildSinglePhase(OperationContext* opCtx, + const NamespaceString& nss) override { ReservedTimes times{opCtx}; for (auto& o : _observers) { o->onAbortIndexBuildSinglePhase(opCtx, nss); } } - virtual void onCommitIndexBuild(OperationContext* opCtx, - const NamespaceString& nss, - CollectionUUID collUUID, - const UUID& indexBuildUUID, - const std::vector<BSONObj>& indexes, - bool fromMigrate) override { + void onCommitIndexBuild(OperationContext* opCtx, + const NamespaceString& nss, + CollectionUUID collUUID, + const UUID& indexBuildUUID, + const std::vector<BSONObj>& indexes, + bool fromMigrate) override { ReservedTimes times{opCtx}; for (auto& o : _observers) { o->onCommitIndexBuild(opCtx, nss, collUUID, indexBuildUUID, indexes, fromMigrate); } } - virtual void onAbortIndexBuild(OperationContext* opCtx, - const NamespaceString& nss, - CollectionUUID collUUID, - const UUID& indexBuildUUID, - const std::vector<BSONObj>& indexes, - const Status& cause, - bool fromMigrate) override { + void onAbortIndexBuild(OperationContext* opCtx, + const NamespaceString& nss, + CollectionUUID collUUID, + const UUID& indexBuildUUID, + const std::vector<BSONObj>& indexes, + const Status& cause, + bool fromMigrate) override { ReservedTimes times{opCtx}; for (auto& o : _observers) { o->onAbortIndexBuild(opCtx, nss, collUUID, indexBuildUUID, indexes, cause, fromMigrate); @@ -123,7 +123,7 @@ public: void onInserts(OperationContext* const opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) override { @@ -148,7 +148,7 @@ public: void onDelete(OperationContext* const opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) override { ReservedTimes times{opCtx}; diff --git a/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp b/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp index 676622692c4..4f728c0583d 100644 --- a/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp +++ b/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp @@ -54,7 +54,7 @@ namespace repl { void OplogApplierImplOpObserver::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) { @@ -71,7 +71,7 @@ void OplogApplierImplOpObserver::onInserts(OperationContext* opCtx, void OplogApplierImplOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OpObserver::OplogDeleteEntryArgs& args) { if (!onDeleteFn) { diff --git a/src/mongo/db/repl/oplog_applier_impl_test_fixture.h b/src/mongo/db/repl/oplog_applier_impl_test_fixture.h index 7cc2cc81e1d..bb02e00bbe8 100644 --- a/src/mongo/db/repl/oplog_applier_impl_test_fixture.h +++ b/src/mongo/db/repl/oplog_applier_impl_test_fixture.h @@ -75,7 +75,7 @@ public: */ void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) override; @@ -85,7 +85,7 @@ public: */ void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) override; diff --git a/src/mongo/db/repl/primary_only_service_op_observer.cpp b/src/mongo/db/repl/primary_only_service_op_observer.cpp index 5c094e14a62..37c1c5631c1 100644 --- a/src/mongo/db/repl/primary_only_service_op_observer.cpp +++ b/src/mongo/db/repl/primary_only_service_op_observer.cpp @@ -59,7 +59,7 @@ void PrimaryOnlyServiceOpObserver::aboutToDelete(OperationContext* opCtx, void PrimaryOnlyServiceOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { auto& documentId = documentIdDecoration(opCtx); diff --git a/src/mongo/db/repl/primary_only_service_op_observer.h b/src/mongo/db/repl/primary_only_service_op_observer.h index dec4118f887..6b1ac9f7b74 100644 --- a/src/mongo/db/repl/primary_only_service_op_observer.h +++ b/src/mongo/db/repl/primary_only_service_op_observer.h @@ -81,10 +81,10 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator first, std::vector<InsertStatement>::const_iterator last, - bool fromMigrate) final{}; + bool fromMigrate) final {} void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final {} @@ -94,7 +94,7 @@ public: void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) final; diff --git a/src/mongo/db/repl/tenant_collection_cloner_test.cpp b/src/mongo/db/repl/tenant_collection_cloner_test.cpp index 3e14fb3ff1a..0fd4bd5cd20 100644 --- a/src/mongo/db/repl/tenant_collection_cloner_test.cpp +++ b/src/mongo/db/repl/tenant_collection_cloner_test.cpp @@ -91,7 +91,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) final { diff --git a/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp b/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp index 9ce82605fc3..633c7d10b14 100644 --- a/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp +++ b/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp @@ -197,7 +197,7 @@ private: void TenantMigrationDonorOpObserver::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator first, std::vector<InsertStatement>::const_iterator last, bool fromMigrate) { @@ -280,7 +280,7 @@ void TenantMigrationDonorOpObserver::aboutToDelete(OperationContext* opCtx, void TenantMigrationDonorOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { if (nss == NamespaceString::kTenantMigrationDonorsNamespace && diff --git a/src/mongo/db/repl/tenant_migration_donor_op_observer.h b/src/mongo/db/repl/tenant_migration_donor_op_observer.h index da948095750..384892910e3 100644 --- a/src/mongo/db/repl/tenant_migration_donor_op_observer.h +++ b/src/mongo/db/repl/tenant_migration_donor_op_observer.h @@ -79,7 +79,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator first, std::vector<InsertStatement>::const_iterator last, bool fromMigrate) final; @@ -92,7 +92,7 @@ public: void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) final; diff --git a/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp b/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp index 8dfaab1cbe8..be3c38e54ce 100644 --- a/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp +++ b/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp @@ -151,7 +151,7 @@ void TenantMigrationRecipientOpObserver::aboutToDelete(OperationContext* opCtx, void TenantMigrationRecipientOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { if (nss == NamespaceString::kTenantMigrationRecipientsNamespace && diff --git a/src/mongo/db/repl/tenant_migration_recipient_op_observer.h b/src/mongo/db/repl/tenant_migration_recipient_op_observer.h index ae654e3c6a1..e2bd11ceccf 100644 --- a/src/mongo/db/repl/tenant_migration_recipient_op_observer.h +++ b/src/mongo/db/repl/tenant_migration_recipient_op_observer.h @@ -80,10 +80,10 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator first, std::vector<InsertStatement>::const_iterator last, - bool fromMigrate) final{}; + bool fromMigrate) final {} void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final; @@ -93,7 +93,7 @@ public: void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) final; diff --git a/src/mongo/db/s/config_server_op_observer.cpp b/src/mongo/db/s/config_server_op_observer.cpp index 48ab254d435..591420d1ce5 100644 --- a/src/mongo/db/s/config_server_op_observer.cpp +++ b/src/mongo/db/s/config_server_op_observer.cpp @@ -59,7 +59,7 @@ ConfigServerOpObserver::~ConfigServerOpObserver() = default; void ConfigServerOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { if (nss == VersionType::ConfigNS) { @@ -106,7 +106,7 @@ void ConfigServerOpObserver::onReplicationRollback(OperationContext* opCtx, void ConfigServerOpObserver::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) { diff --git a/src/mongo/db/s/config_server_op_observer.h b/src/mongo/db/s/config_server_op_observer.h index c5bee193153..7e98af224a9 100644 --- a/src/mongo/db/s/config_server_op_observer.h +++ b/src/mongo/db/s/config_server_op_observer.h @@ -82,7 +82,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) override; @@ -95,7 +95,7 @@ public: void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) override; diff --git a/src/mongo/db/s/resharding/resharding_op_observer.cpp b/src/mongo/db/s/resharding/resharding_op_observer.cpp index 5e1449a383e..7ce89b6a1f6 100644 --- a/src/mongo/db/s/resharding/resharding_op_observer.cpp +++ b/src/mongo/db/s/resharding/resharding_op_observer.cpp @@ -179,7 +179,7 @@ ReshardingOpObserver::~ReshardingOpObserver() = default; void ReshardingOpObserver::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) { @@ -233,7 +233,7 @@ void ReshardingOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEn void ReshardingOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { if (nss == NamespaceString::kDonorReshardingOperationsNamespace) { diff --git a/src/mongo/db/s/resharding/resharding_op_observer.h b/src/mongo/db/s/resharding/resharding_op_observer.h index 8d11ea97b5b..6fbfcc45ea8 100644 --- a/src/mongo/db/s/resharding/resharding_op_observer.h +++ b/src/mongo/db/s/resharding/resharding_op_observer.h @@ -97,7 +97,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) override; @@ -110,7 +110,7 @@ public: void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) override; diff --git a/src/mongo/db/s/shard_server_op_observer.cpp b/src/mongo/db/s/shard_server_op_observer.cpp index ca64c7df032..beb4b8bfa78 100644 --- a/src/mongo/db/s/shard_server_op_observer.cpp +++ b/src/mongo/db/s/shard_server_op_observer.cpp @@ -247,7 +247,7 @@ ShardServerOpObserver::~ShardServerOpObserver() = default; void ShardServerOpObserver::onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) { @@ -475,7 +475,7 @@ void ShardServerOpObserver::aboutToDelete(OperationContext* opCtx, void ShardServerOpObserver::onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { auto& documentId = documentIdDecoration(opCtx); diff --git a/src/mongo/db/s/shard_server_op_observer.h b/src/mongo/db/s/shard_server_op_observer.h index 7bc352bbdfe..2e58ce91690 100644 --- a/src/mongo/db/s/shard_server_op_observer.h +++ b/src/mongo/db/s/shard_server_op_observer.h @@ -79,7 +79,7 @@ public: void onInserts(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, std::vector<InsertStatement>::const_iterator begin, std::vector<InsertStatement>::const_iterator end, bool fromMigrate) override; @@ -92,7 +92,7 @@ public: void onDelete(OperationContext* opCtx, const NamespaceString& nss, - OptionalCollectionUUID uuid, + const UUID& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) override; |