summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/mongo/db/server_transactions_metrics.cpp14
-rw-r--r--src/mongo/db/server_transactions_metrics.h9
-rw-r--r--src/mongo/db/transactions_stats.idl2
3 files changed, 3 insertions, 22 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();
}
diff --git a/src/mongo/db/server_transactions_metrics.h b/src/mongo/db/server_transactions_metrics.h
index d5b829f6845..250b2c41931 100644
--- a/src/mongo/db/server_transactions_metrics.h
+++ b/src/mongo/db/server_transactions_metrics.h
@@ -90,16 +90,9 @@ public:
/**
* Appends the accumulated stats to a transactions stats object.
*/
- void updateStats(TransactionsStats* stats, OperationContext* opCtx);
+ void updateStats(TransactionsStats* stats);
private:
- /**
- * Returns the oldest read timestamp in use by any open unprepared transaction. This will
- * return a null timestamp if there is no oldest open unprepared read timestamp to be
- * returned.
- */
- static Timestamp _getOldestOpenUnpreparedReadTimestamp(OperationContext* opCtx);
-
// The number of multi-document transactions currently active.
AtomicWord<unsigned long long> _currentActive{0};
diff --git a/src/mongo/db/transactions_stats.idl b/src/mongo/db/transactions_stats.idl
index ad70e141d6f..c2a269d4a79 100644
--- a/src/mongo/db/transactions_stats.idl
+++ b/src/mongo/db/transactions_stats.idl
@@ -83,5 +83,3 @@ structs:
currentPrepared:
type: long
default: 0
- oldestOpenUnpreparedReadTimestamp:
- type: timestamp