From a085ddf0bce45c881ae6061fb7b132854f0694e0 Mon Sep 17 00:00:00 2001 From: Benety Goh Date: Thu, 29 Sep 2022 19:47:55 -0400 Subject: SERVER-70092 remove unused parameter from OpObserver::preTransactionPrepare() --- src/mongo/db/auth/auth_op_observer.h | 1 - src/mongo/db/free_mon/free_mon_op_observer.h | 1 - src/mongo/db/op_observer/fcv_op_observer.h | 1 - src/mongo/db/op_observer/op_observer.h | 4 ---- src/mongo/db/op_observer/op_observer_impl.cpp | 1 - src/mongo/db/op_observer/op_observer_impl.h | 1 - src/mongo/db/op_observer/op_observer_impl_test.cpp | 4 ++-- src/mongo/db/op_observer/op_observer_noop.h | 1 - src/mongo/db/op_observer/op_observer_registry.h | 5 ++--- src/mongo/db/op_observer/user_write_block_mode_op_observer.h | 1 - src/mongo/db/repl/primary_only_service_op_observer.h | 1 - src/mongo/db/repl/tenant_migration_donor_op_observer.h | 1 - src/mongo/db/repl/tenant_migration_recipient_op_observer.h | 1 - src/mongo/db/s/config_server_op_observer.h | 1 - src/mongo/db/s/range_deleter_service_op_observer.h | 1 - src/mongo/db/s/resharding/resharding_op_observer.h | 1 - src/mongo/db/s/shard_server_op_observer.h | 1 - src/mongo/db/serverless/shard_split_donor_op_observer.h | 1 - src/mongo/db/transaction/transaction_participant.cpp | 6 +----- src/mongo/db/transaction/transaction_participant_test.cpp | 2 -- src/mongo/idl/cluster_server_parameter_op_observer.h | 1 - 21 files changed, 5 insertions(+), 32 deletions(-) diff --git a/src/mongo/db/auth/auth_op_observer.h b/src/mongo/db/auth/auth_op_observer.h index 365b223f5e7..c2ee0a02ad8 100644 --- a/src/mongo/db/auth/auth_op_observer.h +++ b/src/mongo/db/auth/auth_op_observer.h @@ -216,7 +216,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final { return nullptr; 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 f6284c113df..4cd70414b94 100644 --- a/src/mongo/db/free_mon/free_mon_op_observer.h +++ b/src/mongo/db/free_mon/free_mon_op_observer.h @@ -216,7 +216,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final { return nullptr; diff --git a/src/mongo/db/op_observer/fcv_op_observer.h b/src/mongo/db/op_observer/fcv_op_observer.h index 9cce64d85f4..d9040c52c44 100644 --- a/src/mongo/db/op_observer/fcv_op_observer.h +++ b/src/mongo/db/op_observer/fcv_op_observer.h @@ -210,7 +210,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final { return nullptr; diff --git a/src/mongo/db/op_observer/op_observer.h b/src/mongo/db/op_observer/op_observer.h index c422cb84950..a17706c33dd 100644 --- a/src/mongo/db/op_observer/op_observer.h +++ b/src/mongo/db/op_observer/op_observer.h @@ -486,9 +486,6 @@ public: * The 'reservedSlots' is a list of oplog slots reserved for the oplog entries in a transaction. * The last reserved slot represents the prepareOpTime used for the prepare oplog entry. * - * The 'numberOfPrePostImagesToWrite' is the number of CRUD operations that have a pre-image - * to write as a noop oplog entry. - * * The 'wallClockTime' is the time to record as wall clock time on oplog entries resulting from * transaction preparation. * @@ -498,7 +495,6 @@ public: virtual std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) = 0; diff --git a/src/mongo/db/op_observer/op_observer_impl.cpp b/src/mongo/db/op_observer/op_observer_impl.cpp index 2a9a08e8195..5bbc8e86d1b 100644 --- a/src/mongo/db/op_observer/op_observer_impl.cpp +++ b/src/mongo/db/op_observer/op_observer_impl.cpp @@ -2158,7 +2158,6 @@ void OpObserverImpl::onPreparedTransactionCommit( std::unique_ptr OpObserverImpl::preTransactionPrepare(OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) { auto applyOpsOplogSlotAndOperationAssignment = diff --git a/src/mongo/db/op_observer/op_observer_impl.h b/src/mongo/db/op_observer/op_observer_impl.h index 63fe23e0caa..5a2b1493d70 100644 --- a/src/mongo/db/op_observer/op_observer_impl.h +++ b/src/mongo/db/op_observer/op_observer_impl.h @@ -228,7 +228,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final; diff --git a/src/mongo/db/op_observer/op_observer_impl_test.cpp b/src/mongo/db/op_observer/op_observer_impl_test.cpp index bb54d4bc07a..dba5d537617 100644 --- a/src/mongo/db/op_observer/op_observer_impl_test.cpp +++ b/src/mongo/db/op_observer/op_observer_impl_test.cpp @@ -1145,8 +1145,8 @@ protected: size_t numberOfPrePostImagesToWrite = 0) { auto txnOps = txnParticipant().retrieveCompletedTransactionOperations(opCtx()); auto currentTime = Date_t::now(); - auto applyOpsAssignment = opObserver().preTransactionPrepare( - opCtx(), reservedSlots, numberOfPrePostImagesToWrite, currentTime, txnOps); + auto applyOpsAssignment = + opObserver().preTransactionPrepare(opCtx(), reservedSlots, currentTime, txnOps); opCtx()->recoveryUnit()->setPrepareTimestamp(prepareOpTime.getTimestamp()); opObserver().onTransactionPrepare(opCtx(), reservedSlots, diff --git a/src/mongo/db/op_observer/op_observer_noop.h b/src/mongo/db/op_observer/op_observer_noop.h index fca2d16727f..66344d8e686 100644 --- a/src/mongo/db/op_observer/op_observer_noop.h +++ b/src/mongo/db/op_observer/op_observer_noop.h @@ -195,7 +195,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) override { return nullptr; diff --git a/src/mongo/db/op_observer/op_observer_registry.h b/src/mongo/db/op_observer/op_observer_registry.h index 4848466a403..59e4b9eb83e 100644 --- a/src/mongo/db/op_observer/op_observer_registry.h +++ b/src/mongo/db/op_observer/op_observer_registry.h @@ -433,14 +433,13 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) override { std::unique_ptr applyOpsOplogSlotAndOperationAssignment; for (auto&& observer : _observers) { - auto applyOpsAssignment = observer->preTransactionPrepare( - opCtx, reservedSlots, numberOfPrePostImagesToWrite, wallClockTime, statements); + auto applyOpsAssignment = + observer->preTransactionPrepare(opCtx, reservedSlots, wallClockTime, statements); tassert(6278501, "More than one OpObserver returned operation to \"applyOps\" assignment", !(applyOpsAssignment && applyOpsOplogSlotAndOperationAssignment)); 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 8eab9c9544b..1b03e37a316 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 @@ -240,7 +240,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final { return nullptr; 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 025be4d0617..54707c9ca25 100644 --- a/src/mongo/db/repl/primary_only_service_op_observer.h +++ b/src/mongo/db/repl/primary_only_service_op_observer.h @@ -218,7 +218,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final { return nullptr; 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 2c969e5ac27..58354e9fae8 100644 --- a/src/mongo/db/repl/tenant_migration_donor_op_observer.h +++ b/src/mongo/db/repl/tenant_migration_donor_op_observer.h @@ -215,7 +215,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final { return nullptr; 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 c333dff1bbe..3c501df9c72 100644 --- a/src/mongo/db/repl/tenant_migration_recipient_op_observer.h +++ b/src/mongo/db/repl/tenant_migration_recipient_op_observer.h @@ -217,7 +217,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final { return nullptr; diff --git a/src/mongo/db/s/config_server_op_observer.h b/src/mongo/db/s/config_server_op_observer.h index 9a05b36c19a..a25aa999584 100644 --- a/src/mongo/db/s/config_server_op_observer.h +++ b/src/mongo/db/s/config_server_op_observer.h @@ -218,7 +218,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) override { return nullptr; 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 1ba16b3f698..10a4bfc9e1e 100644 --- a/src/mongo/db/s/range_deleter_service_op_observer.h +++ b/src/mongo/db/s/range_deleter_service_op_observer.h @@ -222,7 +222,6 @@ private: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) override { return nullptr; diff --git a/src/mongo/db/s/resharding/resharding_op_observer.h b/src/mongo/db/s/resharding/resharding_op_observer.h index 73e2ea4c9b7..6759e335f5e 100644 --- a/src/mongo/db/s/resharding/resharding_op_observer.h +++ b/src/mongo/db/s/resharding/resharding_op_observer.h @@ -238,7 +238,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) override { return nullptr; diff --git a/src/mongo/db/s/shard_server_op_observer.h b/src/mongo/db/s/shard_server_op_observer.h index b5e8580f9e0..28c8337e477 100644 --- a/src/mongo/db/s/shard_server_op_observer.h +++ b/src/mongo/db/s/shard_server_op_observer.h @@ -217,7 +217,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) override { return nullptr; 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 58b2a3cef1d..3a9b056cce4 100644 --- a/src/mongo/db/serverless/shard_split_donor_op_observer.h +++ b/src/mongo/db/serverless/shard_split_donor_op_observer.h @@ -214,7 +214,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final { return nullptr; diff --git a/src/mongo/db/transaction/transaction_participant.cpp b/src/mongo/db/transaction/transaction_participant.cpp index 691a7da6365..2b81449e5ed 100644 --- a/src/mongo/db/transaction/transaction_participant.cpp +++ b/src/mongo/db/transaction/transaction_participant.cpp @@ -1681,11 +1681,7 @@ Timestamp TransactionParticipant::Participant::prepareTransaction( auto opObserver = opCtx->getServiceContext()->getOpObserver(); const auto wallClockTime = opCtx->getServiceContext()->getFastClockSource()->now(); auto applyOpsOplogSlotAndOperationAssignment = opObserver->preTransactionPrepare( - opCtx, - reservedSlots, - p().transactionOperations.getNumberOfPrePostImagesToWrite(), - wallClockTime, - completedTransactionOperations); + opCtx, reservedSlots, wallClockTime, completedTransactionOperations); opCtx->recoveryUnit()->setPrepareTimestamp(prepareOplogSlot.getTimestamp()); opCtx->getWriteUnitOfWork()->prepare(); diff --git a/src/mongo/db/transaction/transaction_participant_test.cpp b/src/mongo/db/transaction/transaction_participant_test.cpp index 341334fcc4a..b6b5012ab6f 100644 --- a/src/mongo/db/transaction/transaction_participant_test.cpp +++ b/src/mongo/db/transaction/transaction_participant_test.cpp @@ -102,7 +102,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) override; @@ -157,7 +156,6 @@ public: std::unique_ptr OpObserverMock::preTransactionPrepare(OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) { return std::make_unique( diff --git a/src/mongo/idl/cluster_server_parameter_op_observer.h b/src/mongo/idl/cluster_server_parameter_op_observer.h index 54d7b6aace4..6d83e84658e 100644 --- a/src/mongo/idl/cluster_server_parameter_op_observer.h +++ b/src/mongo/idl/cluster_server_parameter_op_observer.h @@ -220,7 +220,6 @@ public: std::unique_ptr preTransactionPrepare( OperationContext* opCtx, const std::vector& reservedSlots, - size_t numberOfPrePostImagesToWrite, Date_t wallClockTime, std::vector* statements) final { return nullptr; -- cgit v1.2.1