summaryrefslogtreecommitdiff
path: root/src/mongo/db/s
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2019-06-19 14:04:09 -0400
committerJudah Schvimer <judah@mongodb.com>2019-06-25 14:53:45 -0400
commitaad978f94cc92f2bb22a9ed922a71a4ad7adfb93 (patch)
tree1da9401e1f3de25791a90d733e336db907c4c789 /src/mongo/db/s
parent4dba23de42733d08df9829e93e9d726fdf72cd59 (diff)
downloadmongo-aad978f94cc92f2bb22a9ed922a71a4ad7adfb93.tar.gz
SERVER-36529 OpObservers for session operations should pass SessionTxnRecord
(cherry picked from commit 58f209ca5ebe15ffbaec95b26f5b6a7b957f6510)
Diffstat (limited to 'src/mongo/db/s')
-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();