diff options
author | Jordi Serra Torrens <jordi.serra-torrens@mongodb.com> | 2022-09-28 10:11:50 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-11-04 18:50:12 +0000 |
commit | 53973727e253d8b797bc0b2a734326d4e3fdad6d (patch) | |
tree | d4cf0a1effcc98ab265b44317194658c975775b7 /src/mongo/db/repl/tenant_oplog_applier_test.cpp | |
parent | 05cf56be4fdfa33c88d47dfb48f95a60c9cc7e09 (diff) | |
download | mongo-53973727e253d8b797bc0b2a734326d4e3fdad6d.tar.gz |
SERVER-70043 Thread-through CollectionPtr into the onDelete OpObserver
Co-authored-by: Daniel Gómez Ferro <daniel.gomezferro@mongodb.com>
Diffstat (limited to 'src/mongo/db/repl/tenant_oplog_applier_test.cpp')
-rw-r--r-- | src/mongo/db/repl/tenant_oplog_applier_test.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/mongo/db/repl/tenant_oplog_applier_test.cpp b/src/mongo/db/repl/tenant_oplog_applier_test.cpp index 319ef74c58f..bd668250a4f 100644 --- a/src/mongo/db/repl/tenant_oplog_applier_test.cpp +++ b/src/mongo/db/repl/tenant_oplog_applier_test.cpp @@ -742,11 +742,10 @@ TEST_F(TenantOplogApplierTest, ApplyDelete_DatabaseMissing) { auto entry = makeOplogEntry( OpTypeEnum::kDelete, NamespaceString(_dbName.toStringWithTenantId(), "bar"), UUID::gen()); bool onDeleteCalled = false; - _opObserver->onDeleteFn = [&](OperationContext* opCtx, - const NamespaceString&, - boost::optional<UUID>, - StmtId, - const OplogDeleteEntryArgs&) { onDeleteCalled = true; }; + _opObserver->onDeleteFn = + [&](OperationContext* opCtx, const CollectionPtr&, StmtId, const OplogDeleteEntryArgs&) { + onDeleteCalled = true; + }; pushOps({entry}); auto writerPool = makeTenantMigrationWriterPool(); @@ -773,11 +772,10 @@ TEST_F(TenantOplogApplierTest, ApplyDelete_CollectionMissing) { auto entry = makeOplogEntry( OpTypeEnum::kDelete, NamespaceString(_dbName.toStringWithTenantId(), "bar"), UUID::gen()); bool onDeleteCalled = false; - _opObserver->onDeleteFn = [&](OperationContext* opCtx, - const NamespaceString&, - boost::optional<UUID>, - StmtId, - const OplogDeleteEntryArgs&) { onDeleteCalled = true; }; + _opObserver->onDeleteFn = + [&](OperationContext* opCtx, const CollectionPtr&, StmtId, const OplogDeleteEntryArgs&) { + onDeleteCalled = true; + }; pushOps({entry}); auto writerPool = makeTenantMigrationWriterPool(); @@ -804,11 +802,10 @@ TEST_F(TenantOplogApplierTest, ApplyDelete_DocumentMissing) { auto uuid = createCollectionWithUuid(_opCtx.get(), nss); auto entry = makeOplogEntry(OpTypeEnum::kDelete, nss, uuid, BSON("_id" << 0)); bool onDeleteCalled = false; - _opObserver->onDeleteFn = [&](OperationContext* opCtx, - const NamespaceString&, - boost::optional<UUID>, - StmtId, - const OplogDeleteEntryArgs&) { onDeleteCalled = true; }; + _opObserver->onDeleteFn = + [&](OperationContext* opCtx, const CollectionPtr&, StmtId, const OplogDeleteEntryArgs&) { + onDeleteCalled = true; + }; pushOps({entry}); auto writerPool = makeTenantMigrationWriterPool(); @@ -837,8 +834,7 @@ TEST_F(TenantOplogApplierTest, ApplyDelete_Success) { auto entry = makeOplogEntry(OpTypeEnum::kDelete, nss, uuid, BSON("_id" << 0)); bool onDeleteCalled = false; _opObserver->onDeleteFn = [&](OperationContext* opCtx, - const NamespaceString& nss, - const boost::optional<UUID>& observer_uuid, + const CollectionPtr& coll, StmtId, const OplogDeleteEntryArgs& args) { onDeleteCalled = true; @@ -851,7 +847,7 @@ TEST_F(TenantOplogApplierTest, ApplyDelete_Success) { // passes "tid" to the NamespaceString constructor ASSERT_EQUALS(nss.dbName().db(), _dbName.toStringWithTenantId()); ASSERT_EQUALS(nss.coll(), "bar"); - ASSERT_EQUALS(uuid, observer_uuid); + ASSERT_EQUALS(uuid, coll->uuid()); }; pushOps({entry}); auto writerPool = makeTenantMigrationWriterPool(); |