diff options
Diffstat (limited to 'src/mongo/db/s/session_catalog_migration_destination.cpp')
-rw-r--r-- | src/mongo/db/s/session_catalog_migration_destination.cpp | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/mongo/db/s/session_catalog_migration_destination.cpp b/src/mongo/db/s/session_catalog_migration_destination.cpp index 1482462fce9..18e16428f63 100644 --- a/src/mongo/db/s/session_catalog_migration_destination.cpp +++ b/src/mongo/db/s/session_catalog_migration_destination.cpp @@ -89,10 +89,8 @@ void setPrePostImageTs(const ProcessOplogResult& lastResult, repl::MutableOplogE if (!lastResult.isPrePostImage) { uassert(40628, str::stream() << "expected oplog with ts: " << entry->getTimestamp().toString() - << " to not have " - << repl::OplogEntryBase::kPreImageOpTimeFieldName - << " or " - << repl::OplogEntryBase::kPostImageOpTimeFieldName, + << " to not have " << repl::OplogEntryBase::kPreImageOpTimeFieldName + << " or " << repl::OplogEntryBase::kPostImageOpTimeFieldName, !entry->getPreImageOpTime() && !entry->getPostImageOpTime()); return; } @@ -102,14 +100,11 @@ void setPrePostImageTs(const ProcessOplogResult& lastResult, repl::MutableOplogE uassert(40629, str::stream() << "expected oplog with ts: " << entry->getTimestamp().toString() << ": " << redact(entry->toBSON()) - << " to have session: " - << lastResult.sessionId, + << " to have session: " << lastResult.sessionId, lastResult.sessionId == entry->getSessionId()); uassert(40630, str::stream() << "expected oplog with ts: " << entry->getTimestamp().toString() << ": " - << redact(entry->toBSON()) - << " to have txnNumber: " - << lastResult.txnNum, + << redact(entry->toBSON()) << " to have txnNumber: " << lastResult.txnNum, lastResult.txnNum == entry->getTxnNumber()); if (entry->getPreImageOpTime()) { @@ -119,11 +114,8 @@ void setPrePostImageTs(const ProcessOplogResult& lastResult, repl::MutableOplogE } else { uasserted(40631, str::stream() << "expected oplog with opTime: " << entry->getOpTime().toString() - << ": " - << redact(entry->toBSON()) - << " to have either " - << repl::OplogEntryBase::kPreImageOpTimeFieldName - << " or " + << ": " << redact(entry->toBSON()) << " to have either " + << repl::OplogEntryBase::kPreImageOpTimeFieldName << " or " << repl::OplogEntryBase::kPostImageOpTimeFieldName); } } @@ -142,20 +134,17 @@ repl::MutableOplogEntry parseOplog(const BSONObj& oplogBSON) { uassert(ErrorCodes::UnsupportedFormat, str::stream() << "oplog with opTime " << oplogEntry.getTimestamp().toString() - << " does not have sessionId: " - << redact(oplogBSON), + << " does not have sessionId: " << redact(oplogBSON), sessionInfo.getSessionId()); uassert(ErrorCodes::UnsupportedFormat, str::stream() << "oplog with opTime " << oplogEntry.getTimestamp().toString() - << " does not have txnNumber: " - << redact(oplogBSON), + << " does not have txnNumber: " << redact(oplogBSON), sessionInfo.getTxnNumber()); uassert(ErrorCodes::UnsupportedFormat, str::stream() << "oplog with opTime " << oplogEntry.getTimestamp().toString() - << " does not have stmtId: " - << redact(oplogBSON), + << " does not have stmtId: " << redact(oplogBSON), oplogEntry.getStatementId()); return oplogEntry; @@ -225,9 +214,7 @@ ProcessOplogResult processSessionOplog(const BSONObj& oplogBSON, uassert(40632, str::stream() << "Can't handle 2 pre/post image oplog in a row. Prevoius oplog " << lastResult.oplogTime.getTimestamp().toString() - << ", oplog ts: " - << oplogEntry.getTimestamp().toString() - << ": " + << ", oplog ts: " << oplogEntry.getTimestamp().toString() << ": " << oplogBSON, !lastResult.isPrePostImage); } @@ -295,9 +282,7 @@ ProcessOplogResult processSessionOplog(const BSONObj& oplogBSON, const auto& oplogOpTime = result.oplogTime; uassert(40633, str::stream() << "Failed to create new oplog entry for oplog with opTime: " - << oplogEntry.getOpTime().toString() - << ": " - << redact(oplogBSON), + << oplogEntry.getOpTime().toString() << ": " << redact(oplogBSON), !oplogOpTime.isNull()); // Do not call onWriteOpCompletedOnPrimary if we inserted a pre/post image, because the |