summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorMoustafa Maher <m.maher@10gen.com>2020-12-14 19:55:05 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-12-15 21:34:40 +0000
commit3625a82458f886db843d68f9ab4cc1c6fbfac4eb (patch)
tree656094303e1ebd9735fba30cdd5f372752731a54 /src/mongo/db
parentbb3279a62dfc65bdafa5164a7ce85c8322b4757b (diff)
downloadmongo-3625a82458f886db843d68f9ab4cc1c6fbfac4eb.tar.gz
SERVER-53123 Delete unused _stopDataReplication
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state.h5
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state_impl.cpp5
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state_impl.h2
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state_mock.cpp2
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state_mock.h1
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp28
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.h5
7 files changed, 0 insertions, 48 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_external_state.h b/src/mongo/db/repl/replication_coordinator_external_state.h
index f1f2a2da725..b0f6b3b0601 100644
--- a/src/mongo/db/repl/replication_coordinator_external_state.h
+++ b/src/mongo/db/repl/replication_coordinator_external_state.h
@@ -91,11 +91,6 @@ public:
ReplicationCoordinator* replCoord) = 0;
/**
- * Stops the data replication threads = bgsync, applier, reporter.
- */
- virtual void stopDataReplication(OperationContext* opCtx) = 0;
-
- /**
* Performs any necessary external state specific shutdown tasks, such as cleaning up
* the threads it started.
*/
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
index 8ab49b9bba5..8ab05baa398 100644
--- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
@@ -258,11 +258,6 @@ void ReplicationCoordinatorExternalStateImpl::startSteadyStateReplication(
});
}
-void ReplicationCoordinatorExternalStateImpl::stopDataReplication(OperationContext* opCtx) {
- stdx::unique_lock<Latch> lk(_threadMutex);
- _stopDataReplication_inlock(opCtx, lk);
-}
-
void ReplicationCoordinatorExternalStateImpl::_stopDataReplication_inlock(
OperationContext* opCtx, stdx::unique_lock<Latch>& lock) {
// Make sue no other _stopDataReplication calls are in progress.
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.h b/src/mongo/db/repl/replication_coordinator_external_state_impl.h
index 45a30cb6317..a307c512976 100644
--- a/src/mongo/db/repl/replication_coordinator_external_state_impl.h
+++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.h
@@ -69,8 +69,6 @@ public:
virtual void startThreads() override;
virtual void startSteadyStateReplication(OperationContext* opCtx,
ReplicationCoordinator* replCoord) override;
- virtual void stopDataReplication(OperationContext* opCtx) override;
-
virtual bool isInitialSyncFlagSet(OperationContext* opCtx) override;
virtual void shutdown(OperationContext* opCtx);
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_mock.cpp b/src/mongo/db/repl/replication_coordinator_external_state_mock.cpp
index e75ffd983b7..199b1aa965d 100644
--- a/src/mongo/db/repl/replication_coordinator_external_state_mock.cpp
+++ b/src/mongo/db/repl/replication_coordinator_external_state_mock.cpp
@@ -72,8 +72,6 @@ void ReplicationCoordinatorExternalStateMock::startSteadyStateReplication(Operat
ReplicationCoordinator*) {
}
-void ReplicationCoordinatorExternalStateMock::stopDataReplication(OperationContext*) {}
-
Status ReplicationCoordinatorExternalStateMock::initializeReplSetStorage(OperationContext* opCtx,
const BSONObj& config) {
return storeLocalConfigDocument(opCtx, config, false);
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_mock.h b/src/mongo/db/repl/replication_coordinator_external_state_mock.h
index bb9f64424e2..07f7ffbc64e 100644
--- a/src/mongo/db/repl/replication_coordinator_external_state_mock.h
+++ b/src/mongo/db/repl/replication_coordinator_external_state_mock.h
@@ -62,7 +62,6 @@ public:
virtual void startThreads() override;
virtual void startSteadyStateReplication(OperationContext* opCtx,
ReplicationCoordinator* replCoord) override;
- virtual void stopDataReplication(OperationContext* opCtx) override;
virtual bool isInitialSyncFlagSet(OperationContext* opCtx) override;
virtual void shutdown(OperationContext* opCtx);
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index 388496d271a..d8133dcbbd9 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -712,34 +712,6 @@ void ReplicationCoordinatorImpl::_finishLoadLocalConfig(
LOGV2_DEBUG(4280511, 1, "Set local replica set config");
}
-void ReplicationCoordinatorImpl::_stopDataReplication(OperationContext* opCtx) {
- std::shared_ptr<InitialSyncer> initialSyncerCopy;
- {
- stdx::lock_guard<Latch> lk(_mutex);
- _initialSyncer.swap(initialSyncerCopy);
- }
- if (initialSyncerCopy) {
- LOGV2_DEBUG(
- 21321,
- 1,
- "ReplicationCoordinatorImpl::_stopDataReplication calling InitialSyncer::shutdown");
- const auto status = initialSyncerCopy->shutdown();
- if (!status.isOK()) {
- LOGV2_WARNING(21408,
- "InitialSyncer shutdown failed: {error}",
- "InitialSyncer shutdown failed",
- "error"_attr = status);
- }
- initialSyncerCopy.reset();
- // Do not return here, fall through.
- }
- LOGV2_DEBUG(21322,
- 1,
- "ReplicationCoordinatorImpl::_stopDataReplication calling "
- "ReplCoordExtState::stopDataReplication");
- _externalState->stopDataReplication(opCtx);
-}
-
void ReplicationCoordinatorImpl::_startDataReplication(OperationContext* opCtx,
std::function<void()> startCompleted) {
if (_startedSteadyStateReplication.swap(true)) {
diff --git a/src/mongo/db/repl/replication_coordinator_impl.h b/src/mongo/db/repl/replication_coordinator_impl.h
index 6f98191d4ee..1518bcd90b3 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.h
+++ b/src/mongo/db/repl/replication_coordinator_impl.h
@@ -1101,11 +1101,6 @@ private:
std::function<void()> startCompleted = nullptr);
/**
- * Stops replicating data by stopping the applier, fetcher and such.
- */
- void _stopDataReplication(OperationContext* opCtx);
-
- /**
* Finishes the work of processReplSetInitiate() in the event of a successful quorum check.
*/
void _finishReplSetInitiate(OperationContext* opCtx,