summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction_participant_test.cpp
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@mongodb.com>2019-04-03 17:54:56 -0400
committerSamy Lanka <samy.lanka@mongodb.com>2019-04-17 17:05:38 -0400
commit79d96979125e9aaa53774a4e1767b1eb231031a9 (patch)
tree509c096eab3e24ff1118b4849802d5c356691f04 /src/mongo/db/transaction_participant_test.cpp
parentbb452e17d528733e5e645d814bc237d7a26e6c0b (diff)
downloadmongo-79d96979125e9aaa53774a4e1767b1eb231031a9.tar.gz
SERVER-40018 Remove oldestOplogEntryOpTime from TransactionMetricsObserver and TransactionParticipant
Diffstat (limited to 'src/mongo/db/transaction_participant_test.cpp')
-rw-r--r--src/mongo/db/transaction_participant_test.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/mongo/db/transaction_participant_test.cpp b/src/mongo/db/transaction_participant_test.cpp
index ed2a238683f..24c495ea340 100644
--- a/src/mongo/db/transaction_participant_test.cpp
+++ b/src/mongo/db/transaction_participant_test.cpp
@@ -2839,17 +2839,15 @@ void buildPreparedDurationString(StringBuilder* sb,
/*
* Builds the entire expected transaction info string and returns it.
*/
-std::string buildTransactionInfoString(
- OperationContext* opCtx,
- TransactionParticipant::Participant txnParticipant,
- std::string terminationCause,
- const LogicalSessionId sessionId,
- const TxnNumber txnNum,
- const int metricValue,
- const bool wasPrepared,
- bool autocommitVal = false,
- boost::optional<repl::OpTime> prepareOpTime = boost::none,
- boost::optional<repl::OpTime> oldestOplogEntryOpTime = boost::none) {
+std::string buildTransactionInfoString(OperationContext* opCtx,
+ TransactionParticipant::Participant txnParticipant,
+ std::string terminationCause,
+ const LogicalSessionId sessionId,
+ const TxnNumber txnNum,
+ const int metricValue,
+ const bool wasPrepared,
+ bool autocommitVal = false,
+ boost::optional<repl::OpTime> prepareOpTime = boost::none) {
// Calling transactionInfoForLog to get the actual transaction info string.
const auto lockerInfo =
opCtx->lockState()->getLockerInfo(CurOp::get(*opCtx)->getLockStatsBase());
@@ -2898,7 +2896,7 @@ std::string buildTransactionInfoString(
// timeInactiveMicros:2 numYields:0 locks:{ Global: { acquireCount: { r: 6, w: 4 } }, Database:
// { acquireCount: { r: 1, w: 1, W: 2 } }, Collection: { acquireCount: { R: 1 } }, oplog: {
// acquireCount: { W: 1 } } } wasPrepared:1 totalPreparedDurationMicros:10
- // prepareOpTime:<OpTime> oldestOplogEntryOpTime:<OpTime> 0ms
+ // prepareOpTime:<OpTime> 0ms
StringBuilder expectedTransactionInfo;
expectedTransactionInfo << parametersInfo.str() << readTimestampInfo.str()
<< singleTransactionStatsInfo.str()
@@ -2915,15 +2913,7 @@ std::string buildTransactionInfoString(
<< (prepareOpTime ? prepareOpTime->toString()
: txnParticipant.getPrepareOpTime().toString());
}
- if (txnParticipant.getOldestOplogEntryOpTimeForTest()) {
- ASSERT(!oldestOplogEntryOpTime);
- expectedTransactionInfo << " oldestOplogEntryOpTime:"
- << txnParticipant.getOldestOplogEntryOpTimeForTest()->toString();
- }
- if (oldestOplogEntryOpTime) {
- ASSERT(!txnParticipant.getOldestOplogEntryOpTimeForTest());
- expectedTransactionInfo << " oldestOplogEntryOpTime:" << oldestOplogEntryOpTime->toString();
- }
+
expectedTransactionInfo << ", "
<< duration_cast<Milliseconds>(
txnParticipant.getSingleTransactionStatsForTest().getDuration(
@@ -3278,7 +3268,6 @@ TEST_F(TransactionsMetricsTest, LogPreparedTransactionInfoAfterSlowAbort) {
metricValue,
true,
false,
- prepareOpTime,
prepareOpTime);
ASSERT_EQUALS(1, countLogLinesContaining(expectedTransactionInfo));