summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kneiser <matt.kneiser@mongodb.com>2023-04-24 10:39:35 -0700
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-24 18:53:51 +0000
commitdf2b4fa0a434e7f24969f4fa67575b411282a796 (patch)
tree85f03ff046fecdcac4b42fef5ee99541b6896706
parentab76fd41a4dba99f711baa064ceb452045e3e5c6 (diff)
downloadmongo-df2b4fa0a434e7f24969f4fa67575b411282a796.tar.gz
SERVER-76369 Accumulate state among early OpObservers
-rw-r--r--src/mongo/db/auth/auth_op_observer.cpp7
-rw-r--r--src/mongo/db/auth/auth_op_observer.h7
-rw-r--r--src/mongo/db/free_mon/free_mon_op_observer.cpp7
-rw-r--r--src/mongo/db/free_mon/free_mon_op_observer.h7
-rw-r--r--src/mongo/db/op_observer/fcv_op_observer.cpp7
-rw-r--r--src/mongo/db/op_observer/fcv_op_observer.h7
-rw-r--r--src/mongo/db/op_observer/op_observer.h21
-rw-r--r--src/mongo/db/op_observer/op_observer_impl.cpp20
-rw-r--r--src/mongo/db/op_observer/op_observer_impl.h7
-rw-r--r--src/mongo/db/op_observer/op_observer_noop.h7
-rw-r--r--src/mongo/db/op_observer/op_observer_registry.h13
-rw-r--r--src/mongo/db/op_observer/user_write_block_mode_op_observer.cpp6
-rw-r--r--src/mongo/db/op_observer/user_write_block_mode_op_observer.h7
-rw-r--r--src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp6
-rw-r--r--src/mongo/db/repl/oplog_applier_impl_test_fixture.h7
-rw-r--r--src/mongo/db/repl/primary_only_service_op_observer.cpp3
-rw-r--r--src/mongo/db/repl/primary_only_service_op_observer.h7
-rw-r--r--src/mongo/db/repl/shard_merge_recipient_op_observer.cpp6
-rw-r--r--src/mongo/db/repl/shard_merge_recipient_op_observer.h7
-rw-r--r--src/mongo/db/repl/tenant_migration_donor_op_observer.cpp6
-rw-r--r--src/mongo/db/repl/tenant_migration_donor_op_observer.h7
-rw-r--r--src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp6
-rw-r--r--src/mongo/db/repl/tenant_migration_recipient_op_observer.h7
-rw-r--r--src/mongo/db/s/config_server_op_observer.cpp7
-rw-r--r--src/mongo/db/s/config_server_op_observer.h7
-rw-r--r--src/mongo/db/s/query_analysis_op_observer.cpp7
-rw-r--r--src/mongo/db/s/query_analysis_op_observer.h7
-rw-r--r--src/mongo/db/s/range_deleter_service_op_observer.cpp6
-rw-r--r--src/mongo/db/s/range_deleter_service_op_observer.h7
-rw-r--r--src/mongo/db/s/resharding/resharding_op_observer.cpp7
-rw-r--r--src/mongo/db/s/resharding/resharding_op_observer.h7
-rw-r--r--src/mongo/db/s/resharding/resharding_service_test_helpers.h7
-rw-r--r--src/mongo/db/s/shard_server_op_observer.cpp7
-rw-r--r--src/mongo/db/s/shard_server_op_observer.h7
-rw-r--r--src/mongo/db/serverless/shard_split_donor_op_observer.cpp6
-rw-r--r--src/mongo/db/serverless/shard_split_donor_op_observer.h7
-rw-r--r--src/mongo/db/timeseries/timeseries_op_observer.cpp4
-rw-r--r--src/mongo/db/timeseries/timeseries_op_observer.h4
-rw-r--r--src/mongo/idl/cluster_server_parameter_op_observer.cpp6
-rw-r--r--src/mongo/idl/cluster_server_parameter_op_observer.h7
40 files changed, 211 insertions, 84 deletions
diff --git a/src/mongo/db/auth/auth_op_observer.cpp b/src/mongo/db/auth/auth_op_observer.cpp
index 1a61ba188dd..8101bf43dbe 100644
--- a/src/mongo/db/auth/auth_op_observer.cpp
+++ b/src/mongo/db/auth/auth_op_observer.cpp
@@ -63,7 +63,9 @@ void AuthOpObserver::onInserts(OperationContext* opCtx,
}
}
-void AuthOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) {
+void AuthOpObserver::onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.updateArgs->update.isEmpty()) {
return;
}
@@ -87,7 +89,8 @@ void AuthOpObserver::aboutToDelete(OperationContext* opCtx,
void AuthOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
auto& documentId = documentIdDecoration(opCtx);
invariant(!documentId.isEmpty());
AuthorizationManager::get(opCtx->getServiceContext())
diff --git a/src/mongo/db/auth/auth_op_observer.h b/src/mongo/db/auth/auth_op_observer.h
index c3ef4a6ecb1..1d74834e45f 100644
--- a/src/mongo/db/auth/auth_op_observer.h
+++ b/src/mongo/db/auth/auth_op_observer.h
@@ -110,7 +110,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -119,7 +121,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/free_mon/free_mon_op_observer.cpp b/src/mongo/db/free_mon/free_mon_op_observer.cpp
index f8126abcef3..929b1ae5b65 100644
--- a/src/mongo/db/free_mon/free_mon_op_observer.cpp
+++ b/src/mongo/db/free_mon/free_mon_op_observer.cpp
@@ -100,7 +100,9 @@ void FreeMonOpObserver::onInserts(OperationContext* opCtx,
}
}
-void FreeMonOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) {
+void FreeMonOpObserver::onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.coll->ns() != NamespaceString::kServerConfigurationNamespace) {
return;
}
@@ -133,7 +135,8 @@ void FreeMonOpObserver::aboutToDelete(OperationContext* opCtx,
void FreeMonOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (coll->ns() != NamespaceString::kServerConfigurationNamespace) {
return;
}
diff --git a/src/mongo/db/free_mon/free_mon_op_observer.h b/src/mongo/db/free_mon/free_mon_op_observer.h
index f734cb77696..4b4cb139bb1 100644
--- a/src/mongo/db/free_mon/free_mon_op_observer.h
+++ b/src/mongo/db/free_mon/free_mon_op_observer.h
@@ -110,7 +110,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -119,7 +121,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/op_observer/fcv_op_observer.cpp b/src/mongo/db/op_observer/fcv_op_observer.cpp
index dc5518e9fbe..a00aa4bbd8b 100644
--- a/src/mongo/db/op_observer/fcv_op_observer.cpp
+++ b/src/mongo/db/op_observer/fcv_op_observer.cpp
@@ -174,7 +174,9 @@ void FcvOpObserver::onInserts(OperationContext* opCtx,
}
}
-void FcvOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) {
+void FcvOpObserver::onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.updateArgs->update.isEmpty()) {
return;
}
@@ -186,7 +188,8 @@ void FcvOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs
void FcvOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
const auto& nss = coll->ns();
// documentKeyDecoration is set in OpObserverImpl::aboutToDelete. So the FcvOpObserver
// relies on the OpObserverImpl also being in the opObserverRegistry.
diff --git a/src/mongo/db/op_observer/fcv_op_observer.h b/src/mongo/db/op_observer/fcv_op_observer.h
index 152b5b8466f..dc0c704c725 100644
--- a/src/mongo/db/op_observer/fcv_op_observer.h
+++ b/src/mongo/db/op_observer/fcv_op_observer.h
@@ -68,12 +68,15 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
// Noop overrides.
void onCreateGlobalIndex(OperationContext* opCtx,
diff --git a/src/mongo/db/op_observer/op_observer.h b/src/mongo/db/op_observer/op_observer.h
index 4aa505712ec..17ca2b62b6c 100644
--- a/src/mongo/db/op_observer/op_observer.h
+++ b/src/mongo/db/op_observer/op_observer.h
@@ -47,6 +47,20 @@ namespace repl {
class OpTime;
} // namespace repl
+struct OpTimeBundle {
+ repl::OpTime writeOpTime;
+ Date_t wallClockTime;
+};
+
+/**
+ * The generic container for onUpdate/onDelete state-passing between OpObservers. Despite the
+ * naming, some OpObserver's don't strictly observe. This struct is written by OpObserverImpl and
+ * useful for later observers to inspect state they need.
+ */
+struct OpStateAccumulator {
+ OpTimeBundle opTime;
+};
+
enum class RetryableFindAndModifyLocation {
// The operation is not retryable, or not a "findAndModify" command. Do not record a
// pre-image.
@@ -204,7 +218,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) = 0;
- virtual void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) = 0;
+ virtual void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) = 0;
virtual void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -222,7 +238,8 @@ public:
virtual void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) = 0;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) = 0;
/**
* Logs a no-op with "msgObj" in the o field into oplog.
diff --git a/src/mongo/db/op_observer/op_observer_impl.cpp b/src/mongo/db/op_observer/op_observer_impl.cpp
index aace82b6511..67dc07d6e6b 100644
--- a/src/mongo/db/op_observer/op_observer_impl.cpp
+++ b/src/mongo/db/op_observer/op_observer_impl.cpp
@@ -204,11 +204,6 @@ BSONObj makeObject2ForDropOrRename(uint64_t numRecords) {
return obj;
}
-struct OpTimeBundle {
- repl::OpTime writeOpTime;
- Date_t wallClockTime;
-};
-
/**
* Write oplog entry(ies) for the update operation.
*/
@@ -760,7 +755,9 @@ void OpObserverImpl::onDeleteGlobalIndexKey(OperationContext* opCtx,
opCtx, &oplogEntry, _oplogWriter.get(), isRequiredInMultiDocumentTransaction);
}
-void OpObserverImpl::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) {
+void OpObserverImpl::onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
failCollectionUpdates.executeIf(
[&](const BSONObj&) {
uasserted(40654,
@@ -877,6 +874,10 @@ void OpObserverImpl::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArg
}
opTime = replLogUpdate(opCtx, args, &oplogEntry, _oplogWriter.get());
+ if (opAccumulator) {
+ opAccumulator->opTime.writeOpTime = opTime.writeOpTime;
+ opAccumulator->opTime.wallClockTime = opTime.wallClockTime;
+ }
if (oplogEntry.getNeedsRetryImage()) {
// If the oplog entry has `needsRetryImage`, copy the image into image collection.
@@ -970,7 +971,8 @@ void OpObserverImpl::aboutToDelete(OperationContext* opCtx,
void OpObserverImpl::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
const auto& nss = coll->ns();
const auto uuid = coll->uuid();
auto optDocKey = repl::documentKeyDecoration(opCtx);
@@ -1044,6 +1046,10 @@ void OpObserverImpl::onDelete(OperationContext* opCtx,
}
opTime = replLogDelete(
opCtx, nss, &oplogEntry, uuid, stmtId, args.fromMigrate, _oplogWriter.get());
+ if (opAccumulator) {
+ opAccumulator->opTime.writeOpTime = opTime.writeOpTime;
+ opAccumulator->opTime.wallClockTime = opTime.wallClockTime;
+ }
if (oplogEntry.getNeedsRetryImage()) {
auto imageDoc = *(args.deletedDoc);
diff --git a/src/mongo/db/op_observer/op_observer_impl.h b/src/mongo/db/op_observer/op_observer_impl.h
index a22a164fa7c..5fed9eb03d2 100644
--- a/src/mongo/db/op_observer/op_observer_impl.h
+++ b/src/mongo/db/op_observer/op_observer_impl.h
@@ -116,14 +116,17 @@ public:
const BSONObj& key,
const BSONObj& docKey) final;
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
const BSONObj& doc) final;
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
const boost::optional<UUID>& uuid,
diff --git a/src/mongo/db/op_observer/op_observer_noop.h b/src/mongo/db/op_observer/op_observer_noop.h
index 3ba66e80f79..b0fd8915ebc 100644
--- a/src/mongo/db/op_observer/op_observer_noop.h
+++ b/src/mongo/db/op_observer/op_observer_noop.h
@@ -99,14 +99,17 @@ public:
const UUID& globalIndexUuid,
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) override{};
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override{};
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
const BSONObj& doc) override {}
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) override {}
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override {}
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
const boost::optional<UUID>& uuid,
diff --git a/src/mongo/db/op_observer/op_observer_registry.h b/src/mongo/db/op_observer/op_observer_registry.h
index afdedf8b582..297377a0a31 100644
--- a/src/mongo/db/op_observer/op_observer_registry.h
+++ b/src/mongo/db/op_observer/op_observer_registry.h
@@ -179,10 +179,13 @@ public:
o->onDeleteGlobalIndexKey(opCtx, globalIndexNss, globalIndexUuid, key, docKey);
}
- void onUpdate(OperationContext* const opCtx, const OplogUpdateEntryArgs& args) override {
+ void onUpdate(OperationContext* const opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override {
ReservedTimes times{opCtx};
+ OpStateAccumulator opStateAccumulator;
for (auto& o : _observers)
- o->onUpdate(opCtx, args);
+ o->onUpdate(opCtx, args, &opStateAccumulator);
}
void aboutToDelete(OperationContext* const opCtx,
@@ -196,10 +199,12 @@ public:
void onDelete(OperationContext* const opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) override {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override {
ReservedTimes times{opCtx};
+ OpStateAccumulator opStateAccumulator;
for (auto& o : _observers)
- o->onDelete(opCtx, coll, stmtId, args);
+ o->onDelete(opCtx, coll, stmtId, args, &opStateAccumulator);
}
void onInternalOpMessage(OperationContext* const opCtx,
diff --git a/src/mongo/db/op_observer/user_write_block_mode_op_observer.cpp b/src/mongo/db/op_observer/user_write_block_mode_op_observer.cpp
index d9158099dca..8e5b7123c10 100644
--- a/src/mongo/db/op_observer/user_write_block_mode_op_observer.cpp
+++ b/src/mongo/db/op_observer/user_write_block_mode_op_observer.cpp
@@ -91,7 +91,8 @@ void UserWriteBlockModeOpObserver::onInserts(OperationContext* opCtx,
}
void UserWriteBlockModeOpObserver::onUpdate(OperationContext* opCtx,
- const OplogUpdateEntryArgs& args) {
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
const auto& nss = args.coll->ns();
if (args.updateArgs->source != OperationSource::kFromMigrate) {
@@ -141,7 +142,8 @@ void UserWriteBlockModeOpObserver::aboutToDelete(OperationContext* opCtx,
void UserWriteBlockModeOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
const auto& nss = coll->ns();
if (!args.fromMigrate) {
_checkWriteAllowed(opCtx, nss);
diff --git a/src/mongo/db/op_observer/user_write_block_mode_op_observer.h b/src/mongo/db/op_observer/user_write_block_mode_op_observer.h
index e4cc611da70..7f91d860d90 100644
--- a/src/mongo/db/op_observer/user_write_block_mode_op_observer.h
+++ b/src/mongo/db/op_observer/user_write_block_mode_op_observer.h
@@ -68,12 +68,15 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
// DDL operations
void onCreateIndex(OperationContext* opCtx,
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 8c987fc9410..aa4db4d20bb 100644
--- a/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp
+++ b/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp
@@ -75,7 +75,8 @@ void OplogApplierImplOpObserver::onInserts(OperationContext* opCtx,
void OplogApplierImplOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (!onDeleteFn) {
return;
}
@@ -83,7 +84,8 @@ void OplogApplierImplOpObserver::onDelete(OperationContext* opCtx,
}
void OplogApplierImplOpObserver::onUpdate(OperationContext* opCtx,
- const OplogUpdateEntryArgs& args) {
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (!onUpdateFn) {
return;
}
diff --git a/src/mongo/db/repl/oplog_applier_impl_test_fixture.h b/src/mongo/db/repl/oplog_applier_impl_test_fixture.h
index 3d3efe38661..24f87f3e99a 100644
--- a/src/mongo/db/repl/oplog_applier_impl_test_fixture.h
+++ b/src/mongo/db/repl/oplog_applier_impl_test_fixture.h
@@ -87,12 +87,15 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) override;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
/**
* This function is called whenever OplogApplierImpl updates a document in a collection.
*/
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) override;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
/**
* Called when OplogApplierImpl creates a collection.
diff --git a/src/mongo/db/repl/primary_only_service_op_observer.cpp b/src/mongo/db/repl/primary_only_service_op_observer.cpp
index 82d93929c85..55f1a4344c0 100644
--- a/src/mongo/db/repl/primary_only_service_op_observer.cpp
+++ b/src/mongo/db/repl/primary_only_service_op_observer.cpp
@@ -60,7 +60,8 @@ void PrimaryOnlyServiceOpObserver::aboutToDelete(OperationContext* opCtx,
void PrimaryOnlyServiceOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
const auto& nss = coll->ns();
auto& documentId = documentIdDecoration(opCtx);
invariant(!documentId.isEmpty());
diff --git a/src/mongo/db/repl/primary_only_service_op_observer.h b/src/mongo/db/repl/primary_only_service_op_observer.h
index ef4490c0099..6e9c000141d 100644
--- a/src/mongo/db/repl/primary_only_service_op_observer.h
+++ b/src/mongo/db/repl/primary_only_service_op_observer.h
@@ -112,7 +112,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final {}
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final {}
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -121,7 +123,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/repl/shard_merge_recipient_op_observer.cpp b/src/mongo/db/repl/shard_merge_recipient_op_observer.cpp
index f0b5a34ab9d..a69dd362a6a 100644
--- a/src/mongo/db/repl/shard_merge_recipient_op_observer.cpp
+++ b/src/mongo/db/repl/shard_merge_recipient_op_observer.cpp
@@ -366,7 +366,8 @@ void ShardMergeRecipientOpObserver::onInserts(OperationContext* opCtx,
}
void ShardMergeRecipientOpObserver::onUpdate(OperationContext* opCtx,
- const OplogUpdateEntryArgs& args) {
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.coll->ns() != NamespaceString::kShardMergeRecipientsNamespace ||
tenant_migration_access_blocker::inRecoveryMode(opCtx)) {
return;
@@ -433,7 +434,8 @@ void ShardMergeRecipientOpObserver::aboutToDelete(OperationContext* opCtx,
void ShardMergeRecipientOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (coll->ns() != NamespaceString::kShardMergeRecipientsNamespace ||
tenant_migration_access_blocker::inRecoveryMode(opCtx)) {
return;
diff --git a/src/mongo/db/repl/shard_merge_recipient_op_observer.h b/src/mongo/db/repl/shard_merge_recipient_op_observer.h
index 57b4cd668ed..c5d8b6a5276 100644
--- a/src/mongo/db/repl/shard_merge_recipient_op_observer.h
+++ b/src/mongo/db/repl/shard_merge_recipient_op_observer.h
@@ -109,7 +109,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -118,7 +120,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp b/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp
index 1d46d492a44..b92aeb717d5 100644
--- a/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp
+++ b/src/mongo/db/repl/tenant_migration_donor_op_observer.cpp
@@ -279,7 +279,8 @@ void TenantMigrationDonorOpObserver::onInserts(OperationContext* opCtx,
}
void TenantMigrationDonorOpObserver::onUpdate(OperationContext* opCtx,
- const OplogUpdateEntryArgs& args) {
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.coll->ns() == NamespaceString::kTenantMigrationDonorsNamespace &&
!tenant_migration_access_blocker::inRecoveryMode(opCtx)) {
auto donorStateDoc =
@@ -330,7 +331,8 @@ void TenantMigrationDonorOpObserver::aboutToDelete(OperationContext* opCtx,
void TenantMigrationDonorOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (coll->ns() == NamespaceString::kTenantMigrationDonorsNamespace &&
!tenant_migration_access_blocker::inRecoveryMode(opCtx)) {
auto tmi = tenantMigrationInfo(opCtx);
diff --git a/src/mongo/db/repl/tenant_migration_donor_op_observer.h b/src/mongo/db/repl/tenant_migration_donor_op_observer.h
index f7ded62694c..c7a48485044 100644
--- a/src/mongo/db/repl/tenant_migration_donor_op_observer.h
+++ b/src/mongo/db/repl/tenant_migration_donor_op_observer.h
@@ -110,7 +110,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -119,7 +121,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp b/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp
index 14ed2a8fa25..5ccb8fcec63 100644
--- a/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp
+++ b/src/mongo/db/repl/tenant_migration_recipient_op_observer.cpp
@@ -193,7 +193,8 @@ void TenantMigrationRecipientOpObserver::onInserts(
}
void TenantMigrationRecipientOpObserver::onUpdate(OperationContext* opCtx,
- const OplogUpdateEntryArgs& args) {
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.coll->ns() == NamespaceString::kTenantMigrationRecipientsNamespace &&
!tenant_migration_access_blocker::inRecoveryMode(opCtx)) {
auto recipientStateDoc = TenantMigrationRecipientDocument::parse(
@@ -285,7 +286,8 @@ void TenantMigrationRecipientOpObserver::aboutToDelete(OperationContext* opCtx,
void TenantMigrationRecipientOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (coll->ns() == NamespaceString::kTenantMigrationRecipientsNamespace &&
!tenant_migration_access_blocker::inRecoveryMode(opCtx)) {
auto tmi = tenantMigrationInfo(opCtx);
diff --git a/src/mongo/db/repl/tenant_migration_recipient_op_observer.h b/src/mongo/db/repl/tenant_migration_recipient_op_observer.h
index 3ff69365c7e..89a20b518fb 100644
--- a/src/mongo/db/repl/tenant_migration_recipient_op_observer.h
+++ b/src/mongo/db/repl/tenant_migration_recipient_op_observer.h
@@ -111,7 +111,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -120,7 +122,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/s/config_server_op_observer.cpp b/src/mongo/db/s/config_server_op_observer.cpp
index 267b9a23663..8fb62c69503 100644
--- a/src/mongo/db/s/config_server_op_observer.cpp
+++ b/src/mongo/db/s/config_server_op_observer.cpp
@@ -54,7 +54,8 @@ ConfigServerOpObserver::~ConfigServerOpObserver() = default;
void ConfigServerOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (coll->ns() == VersionType::ConfigNS) {
if (!repl::ReplicationCoordinator::get(opCtx)->getMemberState().rollback()) {
uasserted(40302, "cannot delete config.version document while in --configsvr mode");
@@ -155,7 +156,9 @@ void ConfigServerOpObserver::onInserts(OperationContext* opCtx,
}
}
-void ConfigServerOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) {
+void ConfigServerOpObserver::onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.coll->ns().isServerConfigurationCollection()) {
auto idElement = args.updateArgs->updatedDoc["_id"];
if (idElement.type() == BSONType::String &&
diff --git a/src/mongo/db/s/config_server_op_observer.h b/src/mongo/db/s/config_server_op_observer.h
index f551d57bc55..6535e40797e 100644
--- a/src/mongo/db/s/config_server_op_observer.h
+++ b/src/mongo/db/s/config_server_op_observer.h
@@ -113,7 +113,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) override;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -122,7 +124,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) override;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/s/query_analysis_op_observer.cpp b/src/mongo/db/s/query_analysis_op_observer.cpp
index 71b4c4d101b..e3b8f82f79d 100644
--- a/src/mongo/db/s/query_analysis_op_observer.cpp
+++ b/src/mongo/db/s/query_analysis_op_observer.cpp
@@ -77,7 +77,9 @@ void QueryAnalysisOpObserver::onInserts(OperationContext* opCtx,
}
}
-void QueryAnalysisOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) {
+void QueryAnalysisOpObserver::onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (analyze_shard_key::supportsCoordinatingQueryAnalysis(opCtx)) {
if (args.coll->ns() == NamespaceString::kConfigQueryAnalyzersNamespace) {
const auto parsedDoc = QueryAnalyzerDocument::parse(
@@ -124,7 +126,8 @@ void QueryAnalysisOpObserver::aboutToDelete(OperationContext* opCtx,
void QueryAnalysisOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (analyze_shard_key::supportsCoordinatingQueryAnalysis(opCtx)) {
if (coll->ns() == NamespaceString::kConfigQueryAnalyzersNamespace) {
auto& doc = docToDeleteDecoration(opCtx);
diff --git a/src/mongo/db/s/query_analysis_op_observer.h b/src/mongo/db/s/query_analysis_op_observer.h
index 1a13e7e6134..714d50748c9 100644
--- a/src/mongo/db/s/query_analysis_op_observer.h
+++ b/src/mongo/db/s/query_analysis_op_observer.h
@@ -110,7 +110,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -119,7 +121,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/s/range_deleter_service_op_observer.cpp b/src/mongo/db/s/range_deleter_service_op_observer.cpp
index 3123aa306a4..85ea0002623 100644
--- a/src/mongo/db/s/range_deleter_service_op_observer.cpp
+++ b/src/mongo/db/s/range_deleter_service_op_observer.cpp
@@ -104,7 +104,8 @@ void RangeDeleterServiceOpObserver::onInserts(OperationContext* opCtx,
}
void RangeDeleterServiceOpObserver::onUpdate(OperationContext* opCtx,
- const OplogUpdateEntryArgs& args) {
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.coll->ns() == NamespaceString::kRangeDeletionNamespace) {
const bool pendingFieldIsRemoved = [&] {
return update_oplog_entry::isFieldRemovedByUpdate(
@@ -137,7 +138,8 @@ void RangeDeleterServiceOpObserver::aboutToDelete(OperationContext* opCtx,
void RangeDeleterServiceOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (coll->ns() == NamespaceString::kRangeDeletionNamespace) {
const auto& deletedDoc = deletedDocumentDecoration(opCtx);
diff --git a/src/mongo/db/s/range_deleter_service_op_observer.h b/src/mongo/db/s/range_deleter_service_op_observer.h
index 4cfec3eeaae..493e07fcbf9 100644
--- a/src/mongo/db/s/range_deleter_service_op_observer.h
+++ b/src/mongo/db/s/range_deleter_service_op_observer.h
@@ -64,7 +64,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) override;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -73,7 +75,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) override;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
private:
void onModifyCollectionShardingIndexCatalog(OperationContext* opCtx,
diff --git a/src/mongo/db/s/resharding/resharding_op_observer.cpp b/src/mongo/db/s/resharding/resharding_op_observer.cpp
index 3814f7f291c..3ddc9d984f8 100644
--- a/src/mongo/db/s/resharding/resharding_op_observer.cpp
+++ b/src/mongo/db/s/resharding/resharding_op_observer.cpp
@@ -205,7 +205,9 @@ void ReshardingOpObserver::onInserts(OperationContext* opCtx,
}
}
-void ReshardingOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) {
+void ReshardingOpObserver::onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.coll->ns() == NamespaceString::kDonorReshardingOperationsNamespace) {
// Primaries and secondaries should execute pinning logic when observing changes to the
// donor resharding document.
@@ -252,7 +254,8 @@ void ReshardingOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEn
void ReshardingOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (coll->ns() == NamespaceString::kDonorReshardingOperationsNamespace) {
_doPin(opCtx);
}
diff --git a/src/mongo/db/s/resharding/resharding_op_observer.h b/src/mongo/db/s/resharding/resharding_op_observer.h
index 12a6d5d83f3..ee9ac33690b 100644
--- a/src/mongo/db/s/resharding/resharding_op_observer.h
+++ b/src/mongo/db/s/resharding/resharding_op_observer.h
@@ -128,7 +128,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) override;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -137,7 +139,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) override;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/s/resharding/resharding_service_test_helpers.h b/src/mongo/db/s/resharding/resharding_service_test_helpers.h
index e2409bd3878..5151d035897 100644
--- a/src/mongo/db/s/resharding/resharding_service_test_helpers.h
+++ b/src/mongo/db/s/resharding/resharding_service_test_helpers.h
@@ -165,7 +165,9 @@ public:
invariant(++begin == end); // No support for inserting more than one state document yet.
}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) override {
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override {
if (args.coll->ns() != _stateDocumentNss) {
return;
}
@@ -179,7 +181,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) override {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override {
if (coll->ns() != _stateDocumentNss) {
return;
}
diff --git a/src/mongo/db/s/shard_server_op_observer.cpp b/src/mongo/db/s/shard_server_op_observer.cpp
index 22e813a68b7..657db377baa 100644
--- a/src/mongo/db/s/shard_server_op_observer.cpp
+++ b/src/mongo/db/s/shard_server_op_observer.cpp
@@ -270,7 +270,9 @@ void ShardServerOpObserver::onInserts(OperationContext* opCtx,
}
}
-void ShardServerOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) {
+void ShardServerOpObserver::onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
const auto& updateDoc = args.updateArgs->update;
// Most of these handlers do not need to run when the update is a full document replacement.
// An empty updateDoc implies a no-op update and is not a valid oplog entry.
@@ -572,7 +574,8 @@ void ShardServerOpObserver::onModifyCollectionShardingIndexCatalog(OperationCont
void ShardServerOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
const auto& nss = coll->ns();
auto& documentId = documentIdDecoration(opCtx);
invariant(!documentId.isEmpty());
diff --git a/src/mongo/db/s/shard_server_op_observer.h b/src/mongo/db/s/shard_server_op_observer.h
index 9b48d35c372..15f91b3f344 100644
--- a/src/mongo/db/s/shard_server_op_observer.h
+++ b/src/mongo/db/s/shard_server_op_observer.h
@@ -110,7 +110,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) override;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -119,7 +121,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) override;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) override;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/serverless/shard_split_donor_op_observer.cpp b/src/mongo/db/serverless/shard_split_donor_op_observer.cpp
index 5652265bedc..eb864633518 100644
--- a/src/mongo/db/serverless/shard_split_donor_op_observer.cpp
+++ b/src/mongo/db/serverless/shard_split_donor_op_observer.cpp
@@ -330,7 +330,8 @@ void ShardSplitDonorOpObserver::onInserts(OperationContext* opCtx,
}
void ShardSplitDonorOpObserver::onUpdate(OperationContext* opCtx,
- const OplogUpdateEntryArgs& args) {
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (args.coll->ns() != NamespaceString::kShardSplitDonorsNamespace ||
tenant_migration_access_blocker::inRecoveryMode(opCtx)) {
return;
@@ -388,7 +389,8 @@ void ShardSplitDonorOpObserver::aboutToDelete(OperationContext* opCtx,
void ShardSplitDonorOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
if (coll->ns() != NamespaceString::kShardSplitDonorsNamespace || !splitCleanupDetails(opCtx) ||
tenant_migration_access_blocker::inRecoveryMode(opCtx)) {
return;
diff --git a/src/mongo/db/serverless/shard_split_donor_op_observer.h b/src/mongo/db/serverless/shard_split_donor_op_observer.h
index c8e65f7b294..d16ad8bd100 100644
--- a/src/mongo/db/serverless/shard_split_donor_op_observer.h
+++ b/src/mongo/db/serverless/shard_split_donor_op_observer.h
@@ -109,7 +109,9 @@ public:
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
@@ -118,7 +120,8 @@ public:
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onInternalOpMessage(OperationContext* opCtx,
const NamespaceString& nss,
diff --git a/src/mongo/db/timeseries/timeseries_op_observer.cpp b/src/mongo/db/timeseries/timeseries_op_observer.cpp
index 568eaf0cf46..389d5259f27 100644
--- a/src/mongo/db/timeseries/timeseries_op_observer.cpp
+++ b/src/mongo/db/timeseries/timeseries_op_observer.cpp
@@ -76,7 +76,9 @@ void TimeSeriesOpObserver::onInserts(OperationContext* opCtx,
}
}
-void TimeSeriesOpObserver::onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) {
+void TimeSeriesOpObserver::onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
const auto& nss = args.coll->ns();
if (!nss.isTimeseriesBucketsCollection()) {
diff --git a/src/mongo/db/timeseries/timeseries_op_observer.h b/src/mongo/db/timeseries/timeseries_op_observer.h
index e89f256c43e..c36c5756264 100644
--- a/src/mongo/db/timeseries/timeseries_op_observer.h
+++ b/src/mongo/db/timeseries/timeseries_op_observer.h
@@ -52,7 +52,9 @@ public:
std::vector<bool> fromMigrate,
bool defaultFromMigrate) final;
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
diff --git a/src/mongo/idl/cluster_server_parameter_op_observer.cpp b/src/mongo/idl/cluster_server_parameter_op_observer.cpp
index 7ecdc6a9748..6d0e3d37e5f 100644
--- a/src/mongo/idl/cluster_server_parameter_op_observer.cpp
+++ b/src/mongo/idl/cluster_server_parameter_op_observer.cpp
@@ -74,7 +74,8 @@ void ClusterServerParameterOpObserver::onInserts(OperationContext* opCtx,
}
void ClusterServerParameterOpObserver::onUpdate(OperationContext* opCtx,
- const OplogUpdateEntryArgs& args) {
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
auto updatedDoc = args.updateArgs->updatedDoc;
if (!isConfigNamespace(args.coll->ns()) || args.updateArgs->update.isEmpty()) {
return;
@@ -117,7 +118,8 @@ void ClusterServerParameterOpObserver::aboutToDelete(OperationContext* opCtx,
void ClusterServerParameterOpObserver::onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) {
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator) {
const auto& docName = aboutToDeleteDoc(opCtx);
if (!docName.empty()) {
opCtx->recoveryUnit()->onCommit([docName, tenantId = tenantIdToDelete(opCtx)](
diff --git a/src/mongo/idl/cluster_server_parameter_op_observer.h b/src/mongo/idl/cluster_server_parameter_op_observer.h
index a06f4dbde17..dedf7fcbb2c 100644
--- a/src/mongo/idl/cluster_server_parameter_op_observer.h
+++ b/src/mongo/idl/cluster_server_parameter_op_observer.h
@@ -63,14 +63,17 @@ public:
const UUID& globalIndexUuid,
const BSONObj& key,
const BSONObj& docKey) final {}
- void onUpdate(OperationContext* opCtx, const OplogUpdateEntryArgs& args) final;
+ void onUpdate(OperationContext* opCtx,
+ const OplogUpdateEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void aboutToDelete(OperationContext* opCtx,
const CollectionPtr& coll,
const BSONObj& doc) final;
void onDelete(OperationContext* opCtx,
const CollectionPtr& coll,
StmtId stmtId,
- const OplogDeleteEntryArgs& args) final;
+ const OplogDeleteEntryArgs& args,
+ OpStateAccumulator* opAccumulator = nullptr) final;
void onDropDatabase(OperationContext* opCtx, const DatabaseName& dbName) final;
using OpObserver::onDropCollection;
repl::OpTime onDropCollection(OperationContext* opCtx,