From eba18fa8eb20291e3a002f5d8b7b6db92be3d063 Mon Sep 17 00:00:00 2001 From: seanzimm <102551488+seanzimm@users.noreply.github.com> Date: Mon, 16 Sep 2024 17:11:08 -0400 Subject: [PATCH] SERVER-94852: Remove unused failpoints from replication code (#27134) GitOrigin-RevId: 2a1add2c536dbcd1f94b5ef28b2129f4cc85946b --- src/mongo/db/repl/initial_syncer.cpp | 13 ------------- src/mongo/db/repl/initial_syncer.h | 4 ---- src/mongo/db/repl/oplog.cpp | 3 --- src/mongo/db/repl/repl_set_commands.cpp | 5 ----- 4 files changed, 25 deletions(-) diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp index 628be5fcdc5..8e4a8849908 100644 --- a/src/mongo/db/repl/initial_syncer.cpp +++ b/src/mongo/db/repl/initial_syncer.cpp @@ -110,9 +110,6 @@ namespace repl { // Failpoint for initial sync MONGO_FAIL_POINT_DEFINE(failInitialSyncWithBadHost); -// Failpoint which fails initial sync and leaves an oplog entry in the buffer. -MONGO_FAIL_POINT_DEFINE(failInitSyncWithBufferedEntriesLeft); - // Failpoint which causes the initial sync function to hang after getting the oldest active // transaction timestamp from the sync source. MONGO_FAIL_POINT_DEFINE(initialSyncHangAfterGettingBeginFetchingTimestamp); @@ -145,9 +142,6 @@ MONGO_FAIL_POINT_DEFINE(failAndHangInitialSync); // Failpoint which fails initial sync before it applies the next batch of oplog entries. MONGO_FAIL_POINT_DEFINE(failInitialSyncBeforeApplyingBatch); -// Failpoint which fasserts if applying a batch fails. -MONGO_FAIL_POINT_DEFINE(initialSyncFassertIfApplyingBatchFails); - // Failpoint which causes the initial sync function to hang before stopping the oplog fetcher. MONGO_FAIL_POINT_DEFINE(initialSyncHangBeforeCompletingOplogFetching); @@ -1626,13 +1620,6 @@ void InitialSyncer::_multiApplierCallback(const Status& multiApplierStatus, auto status = _checkForShutdownAndConvertStatus_inlock(multiApplierStatus, "error applying batch"); - // Set to cause initial sync to fassert instead of restart if applying a batch fails, so that - // tests can be robust to network errors but not oplog idempotency errors. - if (MONGO_unlikely(initialSyncFassertIfApplyingBatchFails.shouldFail())) { - LOGV2(21189, "initialSyncFassertIfApplyingBatchFails fail point enabled"); - fassert(31210, status); - } - if (!status.isOK()) { LOGV2_ERROR(21199, "Failed to apply batch", "error"_attr = redact(status)); onCompletionGuard->setResultAndCancelRemainingWork_inlock(lock, status); diff --git a/src/mongo/db/repl/initial_syncer.h b/src/mongo/db/repl/initial_syncer.h index a07d65a0fbf..7949519fe1a 100644 --- a/src/mongo/db/repl/initial_syncer.h +++ b/src/mongo/db/repl/initial_syncer.h @@ -79,10 +79,6 @@ namespace mongo { namespace repl { -// TODO: Remove forward declares once we remove rs_initialsync.cpp and other dependents. -// Failpoint which fails initial sync and leaves an oplog entry in the buffer. -extern FailPoint failInitSyncWithBufferedEntriesLeft; - // Failpoint which causes the initial sync function to hang before copying databases. extern FailPoint initialSyncHangBeforeCopyingDatabases; diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index a1f218c4f7c..3d3af821c79 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -173,9 +173,6 @@ using IndexVersion = IndexDescriptor::IndexVersion; namespace repl { namespace { -// Failpoint to block after a write and its oplog entry have been written to the storage engine and -// are visible, but before we have advanced 'lastApplied' for the write. -MONGO_FAIL_POINT_DEFINE(hangBeforeLogOpAdvancesLastApplied); // Failpoint to block oplog application after receiving an IndexBuildAlreadyInProgress error. MONGO_FAIL_POINT_DEFINE(hangAfterIndexBuildConflict); diff --git a/src/mongo/db/repl/repl_set_commands.cpp b/src/mongo/db/repl/repl_set_commands.cpp index 7e173061ed9..f467f1a2370 100644 --- a/src/mongo/db/repl/repl_set_commands.cpp +++ b/src/mongo/db/repl/repl_set_commands.cpp @@ -783,8 +783,6 @@ bool replHasDatabases(OperationContext* opCtx) { } // namespace -MONGO_FAIL_POINT_DEFINE(rsDelayHeartbeatResponse); - /* { replSetHeartbeat : } */ class CmdReplSetHeartbeat : public ReplSetCommand { public: @@ -793,9 +791,6 @@ public: const DatabaseName&, const BSONObj& cmdObj, BSONObjBuilder& result) override { - rsDelayHeartbeatResponse.execute( - [&](const BSONObj& data) { sleepsecs(data["delay"].numberInt()); }); - LOGV2_FOR_HEARTBEATS(24095, 2, "Received heartbeat request",