diff options
Diffstat (limited to 'src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp')
| -rw-r--r-- | src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp | 39 |
1 files changed, 5 insertions, 34 deletions
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 4afe05e7bc5..949a69c2a29 100644 --- a/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp +++ b/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp @@ -32,9 +32,7 @@ #include "mongo/db/repl/oplog_applier_impl_test_fixture.h" #include "mongo/db/catalog/document_validation.h" -#include "mongo/db/catalog/health_log.h" -#include "mongo/db/catalog/health_log_interface.h" -#include "mongo/db/concurrency/exception_util.h" +#include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/curop.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" @@ -184,22 +182,14 @@ void OplogApplierImplTest::setUp() { // This is necessary to generate ghost timestamps for index builds that are not 0, since 0 is an // invalid timestamp. VectorClockMutable::get(_opCtx.get())->tickClusterTimeTo(LogicalTime(Timestamp(1, 0))); - - HealthLogInterface::set(serviceContext, std::make_unique<HealthLog>()); - HealthLogInterface::get(serviceContext)->startup(); } void OplogApplierImplTest::tearDown() { - HealthLogInterface::get(serviceContext)->shutdown(); _opCtx.reset(); _consistencyMarkers = {}; DropPendingCollectionReaper::set(serviceContext, {}); StorageInterface::set(serviceContext, {}); ServiceContextMongoDTest::tearDown(); - - for (auto serverParamController : _serverParamControllers) { - serverParamController.reset(); - } } ReplicationConsistencyMarkers* OplogApplierImplTest::getConsistencyMarkers() const { @@ -223,10 +213,7 @@ Status OplogApplierImplTest::_applyOplogEntryOrGroupedInsertsWrapper( } void OplogApplierImplTest::_testApplyOplogEntryOrGroupedInsertsCrudOperation( - ErrorCodes::Error expectedError, - const OplogEntry& op, - const NamespaceString& targetNss, - bool expectedApplyOpCalled) { + ErrorCodes::Error expectedError, const OplogEntry& op, bool expectedApplyOpCalled) { bool applyOpCalled = false; auto checkOpCtx = [](OperationContext* opCtx) { @@ -241,14 +228,9 @@ void OplogApplierImplTest::_testApplyOplogEntryOrGroupedInsertsCrudOperation( _opObserver->onInsertsFn = [&](OperationContext* opCtx, const NamespaceString& nss, const std::vector<BSONObj>& docs) { - // Other threads may be calling into the opObserver. Only assert if we are writing to - // the target ns, otherwise skip these asserts. - if (targetNss != nss) { - return Status::OK(); - } - applyOpCalled = true; checkOpCtx(opCtx); + ASSERT_EQUALS(NamespaceString("test.t"), nss); ASSERT_EQUALS(1U, docs.size()); // For upserts we don't know the intended value of the document. if (op.getOpType() == repl::OpTypeEnum::kInsert) { @@ -262,28 +244,18 @@ void OplogApplierImplTest::_testApplyOplogEntryOrGroupedInsertsCrudOperation( const boost::optional<UUID>& uuid, StmtId stmtId, const OplogDeleteEntryArgs& args) { - // Other threads may be calling into the opObserver. Only assert if we are writing to - // the target ns, otherwise skip these asserts. - if (targetNss != nss) { - return Status::OK(); - } - applyOpCalled = true; checkOpCtx(opCtx); + ASSERT_EQUALS(NamespaceString("test.t"), nss); ASSERT(args.deletedDoc); ASSERT_BSONOBJ_EQ(op.getObject(), *(args.deletedDoc)); return Status::OK(); }; _opObserver->onUpdateFn = [&](OperationContext* opCtx, const OplogUpdateEntryArgs& args) { - // Other threads may be calling into the opObserver. Only assert if we are writing to - // the target ns, otherwise skip these asserts. - if (targetNss != args.nss) { - return Status::OK(); - } - applyOpCalled = true; checkOpCtx(opCtx); + ASSERT_EQUALS(NamespaceString("test.t"), args.nss); return Status::OK(); }; @@ -441,7 +413,6 @@ OplogEntry makeOplogEntry(OpTypeEnum opType, nss, // namespace uuid, // uuid fromMigrate, // fromMigrate - boost::none, // checkExistenceForDiffInsert OplogEntry::kOplogVersion, // version o, // o o2, // o2 |
