diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-03-20 11:19:00 -0400 |
---|---|---|
committer | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-03-21 18:19:34 -0400 |
commit | daa7dbf7e4564fc38b946416e3240caeb3c59b3a (patch) | |
tree | 66fbd802be5504e1b0f2a5b3d3b830cca7b90752 /src/mongo/db/s/session_catalog_migration_source.cpp | |
parent | fba785c14c3a5a45d85cf27a1af5be848b106342 (diff) | |
download | mongo-daa7dbf7e4564fc38b946416e3240caeb3c59b3a.tar.gz |
SERVER-33971 Generate session sentinel oplog entry with wall clock time
Diffstat (limited to 'src/mongo/db/s/session_catalog_migration_source.cpp')
-rw-r--r-- | src/mongo/db/s/session_catalog_migration_source.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/db/s/session_catalog_migration_source.cpp b/src/mongo/db/s/session_catalog_migration_source.cpp index 36190bf1cd4..952e536811d 100644 --- a/src/mongo/db/s/session_catalog_migration_source.cpp +++ b/src/mongo/db/s/session_catalog_migration_source.cpp @@ -78,6 +78,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime, const BSONObj& oField, const boost::optional<BSONObj>& o2Field, const OperationSessionInfo& sessionInfo, + Date_t wallClockTime, const boost::optional<StmtId>& statementId) { return repl::OplogEntry(opTime, // optime hash, // hash @@ -90,7 +91,7 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime, o2Field, // o2 sessionInfo, // session info boost::none, // upsert - boost::none, // wall clock time + wallClockTime, // wall clock time statementId, // statement id boost::none, // optime of previous write within same transaction boost::none, // pre-image optime @@ -100,13 +101,14 @@ repl::OplogEntry makeOplogEntry(repl::OpTime opTime, /** * Creates a special "write history lost" sentinel oplog entry. */ -repl::OplogEntry makeSentinelOplogEntry(OperationSessionInfo sessionInfo) { +repl::OplogEntry makeSentinelOplogEntry(OperationSessionInfo sessionInfo, Date_t wallClockTime) { return makeOplogEntry({}, // optime hashGenerator.nextInt64(), // hash repl::OpTypeEnum::kNoop, // op type {}, // o Session::kDeadEndSentinel, // o2 sessionInfo, // session info + wallClockTime, // wall clock time kIncompleteHistoryStmtId); // statement id } @@ -337,7 +339,8 @@ repl::OplogEntry SessionCatalogMigrationSource::SessionOplogIterator::getNext( OperationSessionInfo sessionInfo; sessionInfo.setSessionId(_record.getSessionId()); sessionInfo.setTxnNumber(_record.getTxnNum()); - auto oplog = makeSentinelOplogEntry(sessionInfo); + auto oplog = makeSentinelOplogEntry( + sessionInfo, opCtx->getServiceContext()->getFastClockSource()->now()); _writeHistoryIterator.reset(); |