summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/repl/bgsync.cpp2
-rw-r--r--src/mongo/db/repl/bgsync.h1
-rw-r--r--src/mongo/db/repl/initial_syncer.cpp1
-rw-r--r--src/mongo/db/repl/oplog_applier.h6
-rw-r--r--src/mongo/db/repl/replication_recovery.cpp1
-rw-r--r--src/mongo/db/repl/sync_tail.cpp13
-rw-r--r--src/mongo/db/repl/sync_tail_test.cpp1
-rw-r--r--src/mongo/dbtests/storage_timestamp_tests.cpp1
8 files changed, 5 insertions, 21 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index 2142931dc20..43d0173caf0 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -552,8 +552,6 @@ Status BackgroundSync::_enqueueDocuments(Fetcher::Documents::const_iterator begi
return Status::OK();
}
-void BackgroundSync::onOperationConsumed(const BSONObj& op) {}
-
void BackgroundSync::_runRollback(OperationContext* opCtx,
const Status& fetcherReturnStatus,
const HostAndPort& source,
diff --git a/src/mongo/db/repl/bgsync.h b/src/mongo/db/repl/bgsync.h
index 704464c109b..76d12f37225 100644
--- a/src/mongo/db/repl/bgsync.h
+++ b/src/mongo/db/repl/bgsync.h
@@ -147,7 +147,6 @@ public:
void onBatchBegin(const OplogApplier::Operations&) final {}
void onBatchEnd(const StatusWith<OpTime>&, const OplogApplier::Operations&) final {}
void onMissingDocumentsFetchedAndInserted(const std::vector<FetchInfo>&) final {}
- void onOperationConsumed(const BSONObj& op) final;
private:
bool _inShutdown_inlock() const;
diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp
index 9ed2fb28232..c9d08a98b64 100644
--- a/src/mongo/db/repl/initial_syncer.cpp
+++ b/src/mongo/db/repl/initial_syncer.cpp
@@ -177,7 +177,6 @@ public:
void onMissingDocumentsFetchedAndInserted(const std::vector<FetchInfo>& docs) final {
_fetchCount->fetchAndAdd(docs.size());
}
- void onOperationConsumed(const BSONObj& op) final {}
private:
AtomicUInt32* const _fetchCount;
diff --git a/src/mongo/db/repl/oplog_applier.h b/src/mongo/db/repl/oplog_applier.h
index 6f44e5fadaf..110fcc7a1fa 100644
--- a/src/mongo/db/repl/oplog_applier.h
+++ b/src/mongo/db/repl/oplog_applier.h
@@ -228,12 +228,6 @@ public:
using FetchInfo = std::pair<OplogEntry, BSONObj>;
virtual void onMissingDocumentsFetchedAndInserted(
const std::vector<FetchInfo>& documentsFetchedAndInserted) = 0;
-
- /**
- * Used primarily by BackgroundSync to update server statistics during steady state replication.
- * TODO: remove this function. See SERVER-33864.
- */
- virtual void onOperationConsumed(const BSONObj& op) = 0;
};
} // namespace repl
diff --git a/src/mongo/db/repl/replication_recovery.cpp b/src/mongo/db/repl/replication_recovery.cpp
index 44cba166c52..db74d511246 100644
--- a/src/mongo/db/repl/replication_recovery.cpp
+++ b/src/mongo/db/repl/replication_recovery.cpp
@@ -82,7 +82,6 @@ public:
void onBatchEnd(const StatusWith<OpTime>&, const OplogApplier::Operations&) final {}
void onMissingDocumentsFetchedAndInserted(const std::vector<FetchInfo>&) final {}
- void onOperationConsumed(const BSONObj& op) final {}
void complete(const OpTime& applyThroughOpTime) const {
LOG_FOR_RECOVERY(kRecoveryBatchLogLevel)
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp
index e7d1f23a60d..133ecacd2d0 100644
--- a/src/mongo/db/repl/sync_tail.cpp
+++ b/src/mongo/db/repl/sync_tail.cpp
@@ -1000,15 +1000,12 @@ bool SyncTail::tryPopAndWaitForMore(OperationContext* opCtx,
void SyncTail::_consume(OperationContext* opCtx, OplogBuffer* oplogBuffer) {
// This is just to get the op off the queue; it's been peeked at and queued for application
// already.
+ // If we failed to get an op off the queue, this means that shutdown() was called between the
+ // consumer's calls to peek() and consume(). shutdown() cleared the buffer so there is nothing
+ // for us to consume here. Since our postcondition is already met, it is safe to return
+ // successfully.
BSONObj op;
- if (oplogBuffer->tryPop(opCtx, &op)) {
- _observer->onOperationConsumed(op);
- } else {
- invariant(inShutdown());
- // This means that shutdown() was called between the consumer's calls to peek() and
- // consume(). shutdown() cleared the buffer so there is nothing for us to consume here.
- // Since our postcondition is already met, it is safe to return successfully.
- }
+ invariant(oplogBuffer->tryPop(opCtx, &op) || inShutdown());
}
void SyncTail::shutdown() {
diff --git a/src/mongo/db/repl/sync_tail_test.cpp b/src/mongo/db/repl/sync_tail_test.cpp
index 123a7eb3a14..c57c868bd14 100644
--- a/src/mongo/db/repl/sync_tail_test.cpp
+++ b/src/mongo/db/repl/sync_tail_test.cpp
@@ -110,7 +110,6 @@ public:
void onMissingDocumentsFetchedAndInserted(const std::vector<FetchInfo>& docs) final {
numFetched += docs.size();
}
- void onOperationConsumed(const BSONObj& op) final {}
std::size_t numFetched = 0U;
diff --git a/src/mongo/dbtests/storage_timestamp_tests.cpp b/src/mongo/dbtests/storage_timestamp_tests.cpp
index 1bcb57c8951..333985aa671 100644
--- a/src/mongo/dbtests/storage_timestamp_tests.cpp
+++ b/src/mongo/dbtests/storage_timestamp_tests.cpp
@@ -116,7 +116,6 @@ public:
void onBatchBegin(const repl::OplogApplier::Operations&) final {}
void onBatchEnd(const StatusWith<repl::OpTime>&, const repl::OplogApplier::Operations&) final {}
void onMissingDocumentsFetchedAndInserted(const std::vector<FetchInfo>&) final {}
- void onOperationConsumed(const BSONObj&) final {}
};
class StorageTimestampTest {