diff options
-rw-r--r-- | src/mongo/db/op_observer_impl.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/op_observer_impl.h | 4 | ||||
-rw-r--r-- | src/mongo/db/s/op_observer_sharding_impl.cpp | 12 | ||||
-rw-r--r-- | src/mongo/db/s/op_observer_sharding_impl.h | 4 |
4 files changed, 10 insertions, 14 deletions
diff --git a/src/mongo/db/op_observer_impl.cpp b/src/mongo/db/op_observer_impl.cpp index 860b92c7138..d12bfe0548b 100644 --- a/src/mongo/db/op_observer_impl.cpp +++ b/src/mongo/db/op_observer_impl.cpp @@ -1259,7 +1259,7 @@ void OpObserverImpl::onUnpreparedTransactionCommit( opCtx, statements.size() /* stmtId */, oplogSlots.back().opTime, commitSlot); } invariant(!commitOpTime.isNull()); - shardObserveTransactionPrepareOrUnpreparedCommit(opCtx, statements, commitOpTime); + shardObserveTransactionPrepareOrUnpreparedCommit(opCtx, statements); } void OpObserverImpl::onPreparedTransactionCommit( @@ -1380,7 +1380,7 @@ void OpObserverImpl::onTransactionPrepare(OperationContext* opCtx, }); } - shardObserveTransactionPrepareOrUnpreparedCommit(opCtx, statements, {}); + shardObserveTransactionPrepareOrUnpreparedCommit(opCtx, statements); } void OpObserverImpl::onTransactionAbort(OperationContext* opCtx, diff --git a/src/mongo/db/op_observer_impl.h b/src/mongo/db/op_observer_impl.h index 5cd3186c89b..b2a4d52a223 100644 --- a/src/mongo/db/op_observer_impl.h +++ b/src/mongo/db/op_observer_impl.h @@ -179,9 +179,7 @@ private: const repl::OpTime& preImageOpTime, const bool inMultiDocumentTransaction) {} virtual void shardObserveTransactionPrepareOrUnpreparedCommit( - OperationContext* opCtx, - const std::vector<repl::ReplOperation>& stmts, - const repl::OpTime& opTime) {} + OperationContext* opCtx, const std::vector<repl::ReplOperation>& stmts) {} }; } // namespace mongo diff --git a/src/mongo/db/s/op_observer_sharding_impl.cpp b/src/mongo/db/s/op_observer_sharding_impl.cpp index 42e67ba950c..d4eff6b15d9 100644 --- a/src/mongo/db/s/op_observer_sharding_impl.cpp +++ b/src/mongo/db/s/op_observer_sharding_impl.cpp @@ -161,9 +161,7 @@ void OpObserverShardingImpl::shardObserveDeleteOp(OperationContext* opCtx, } void OpObserverShardingImpl::shardObserveTransactionPrepareOrUnpreparedCommit( - OperationContext* opCtx, - const std::vector<repl::ReplOperation>& stmts, - const repl::OpTime& opTime) { + OperationContext* opCtx, const std::vector<repl::ReplOperation>& stmts) { for (const auto stmt : stmts) { auto const nss = stmt.getNss(); @@ -178,16 +176,18 @@ void OpObserverShardingImpl::shardObserveTransactionPrepareOrUnpreparedCommit( auto const opType = stmt.getOpType(); + // We pass an empty opTime to observers because retryable write history doesn't care about + // writes in transactions. if (opType == repl::OpTypeEnum::kInsert) { - msm->getCloner()->onInsertOp(opCtx, stmt.getObject(), opTime); + msm->getCloner()->onInsertOp(opCtx, stmt.getObject(), {}); } else if (opType == repl::OpTypeEnum::kUpdate) { if (auto updateDoc = stmt.getObject2()) { - msm->getCloner()->onUpdateOp(opCtx, *updateDoc, opTime, {}); + msm->getCloner()->onUpdateOp(opCtx, *updateDoc, {}, {}); } } else if (opType == repl::OpTypeEnum::kDelete) { if (isMigratingWithCSRLock(csr, csrLock, stmt.getObject())) { msm->getCloner()->onDeleteOp( - opCtx, getDocumentKey(opCtx, nss, stmt.getObject()), opTime, {}); + opCtx, getDocumentKey(opCtx, nss, stmt.getObject()), {}, {}); } } } diff --git a/src/mongo/db/s/op_observer_sharding_impl.h b/src/mongo/db/s/op_observer_sharding_impl.h index 45efefdc262..5232c8f92d9 100644 --- a/src/mongo/db/s/op_observer_sharding_impl.h +++ b/src/mongo/db/s/op_observer_sharding_impl.h @@ -65,9 +65,7 @@ protected: const repl::OpTime& preImageOpTime, const bool inMultiDocumentTransaction) override; void shardObserveTransactionPrepareOrUnpreparedCommit( - OperationContext* opCtx, - const std::vector<repl::ReplOperation>& stmts, - const repl::OpTime& opTime) override; + OperationContext* opCtx, const std::vector<repl::ReplOperation>& stmts) override; }; } // namespace mongo |