summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/session_catalog_migration_destination.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/session_catalog_migration_destination.cpp')
-rw-r--r--src/mongo/db/s/session_catalog_migration_destination.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/s/session_catalog_migration_destination.cpp b/src/mongo/db/s/session_catalog_migration_destination.cpp
index 1a900129e2f..fd6a3086dd7 100644
--- a/src/mongo/db/s/session_catalog_migration_destination.cpp
+++ b/src/mongo/db/s/session_catalog_migration_destination.cpp
@@ -318,8 +318,13 @@ ProcessOplogResult processSessionOplog(const BSONObj& oplogBSON,
// Do not call onWriteOpCompletedOnPrimary if we inserted a pre/post image, because the
// next oplog will contain the real operation
if (!result.isPrePostImage) {
- txnParticipant.onMigrateCompletedOnPrimary(
- opCtx, result.txnNum, {stmtId}, oplogOpTime, *oplogEntry.getWallClockTime());
+ SessionTxnRecord sessionTxnRecord;
+ sessionTxnRecord.setSessionId(result.sessionId);
+ sessionTxnRecord.setTxnNum(result.txnNum);
+ sessionTxnRecord.setLastWriteOpTime(oplogOpTime);
+ sessionTxnRecord.setLastWriteDate(*oplogEntry.getWallClockTime());
+ // We do not migrate transaction oplog entries so don't set the txn state.
+ txnParticipant.onMigrateCompletedOnPrimary(opCtx, {stmtId}, sessionTxnRecord);
}
wunit.commit();