summaryrefslogtreecommitdiff
path: root/src/mongo/db/server_transactions_metrics.cpp
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2019-04-05 10:52:43 -0400
committerLingzhi Deng <lingzhi.deng@mongodb.com>2019-04-09 12:45:33 -0400
commitdecf670a6d7ec7a31c3820032188aab3fdc0fbd1 (patch)
tree6a719219ba181ca0d64b193c93ff003ba71f95d6 /src/mongo/db/server_transactions_metrics.cpp
parent9f40ea669153868ee1df20ff8952b4f264198ce1 (diff)
downloadmongo-decf670a6d7ec7a31c3820032188aab3fdc0fbd1.tar.gz
SERVER-40337: Remove oldestOpenUnpreparedReadTimestamp from serverStatus.transactions
This reverts most of the work done in 3bb72042c29ceac96ec628ee643cbc4db8e982ab
Diffstat (limited to 'src/mongo/db/server_transactions_metrics.cpp')
-rw-r--r--src/mongo/db/server_transactions_metrics.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/mongo/db/server_transactions_metrics.cpp b/src/mongo/db/server_transactions_metrics.cpp
index 54300a1ca26..1daa320782d 100644
--- a/src/mongo/db/server_transactions_metrics.cpp
+++ b/src/mongo/db/server_transactions_metrics.cpp
@@ -149,15 +149,7 @@ void ServerTransactionsMetrics::decrementCurrentPrepared() {
_currentPrepared.fetchAndSubtract(1);
}
-Timestamp ServerTransactionsMetrics::_getOldestOpenUnpreparedReadTimestamp(
- OperationContext* opCtx) {
- // The history is not pinned in memory once a transaction has been prepared since reads
- // are no longer possible. Therefore, the timestamp returned by the storage engine refers
- // to the oldest read timestamp for any open unprepared transaction.
- return opCtx->getServiceContext()->getStorageEngine()->getOldestOpenReadTimestamp();
-}
-
-void ServerTransactionsMetrics::updateStats(TransactionsStats* stats, OperationContext* opCtx) {
+void ServerTransactionsMetrics::updateStats(TransactionsStats* stats) {
stats->setCurrentActive(_currentActive.load());
stats->setCurrentInactive(_currentInactive.load());
stats->setCurrentOpen(_currentOpen.load());
@@ -168,8 +160,6 @@ void ServerTransactionsMetrics::updateStats(TransactionsStats* stats, OperationC
stats->setTotalPreparedThenCommitted(_totalPreparedThenCommitted.load());
stats->setTotalPreparedThenAborted(_totalPreparedThenAborted.load());
stats->setCurrentPrepared(_currentPrepared.load());
- stats->setOldestOpenUnpreparedReadTimestamp(
- ServerTransactionsMetrics::_getOldestOpenUnpreparedReadTimestamp(opCtx));
}
namespace {
@@ -192,7 +182,7 @@ public:
// lifecycle within a session. Both are assigned transaction numbers, and so both are often
// referred to as “transactions”.
RetryableWritesStats::get(opCtx)->updateStats(&stats);
- ServerTransactionsMetrics::get(opCtx)->updateStats(&stats, opCtx);
+ ServerTransactionsMetrics::get(opCtx)->updateStats(&stats);
return stats.toBSON();
}