summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
commit4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch)
tree1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp
parentaa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff)
parent8f0827553e09872941945a093b647a4211a9db7f (diff)
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0' with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
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.cpp39
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