diff options
author | Pavi Vetriselvan <pvselvan@umich.edu> | 2018-09-20 11:06:37 -0400 |
---|---|---|
committer | Pavi Vetriselvan <pvselvan@umich.edu> | 2018-09-20 11:08:04 -0400 |
commit | dc4fd67df2cbfdd4977007463cce8bbb25ffdd4d (patch) | |
tree | 55c1c21f2ccad68966e96f3d12e869daf5f9245b /src/mongo/db/transaction_metrics_observer.h | |
parent | c69ec130f14953056461cf40ddf368d8ecf7185b (diff) | |
download | mongo-dc4fd67df2cbfdd4977007463cce8bbb25ffdd4d.tar.gz |
SERVER-35873 Maintain oldest prepareTimestamp
Diffstat (limited to 'src/mongo/db/transaction_metrics_observer.h')
-rw-r--r-- | src/mongo/db/transaction_metrics_observer.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/mongo/db/transaction_metrics_observer.h b/src/mongo/db/transaction_metrics_observer.h index e3de57539b6..1ec30bedfff 100644 --- a/src/mongo/db/transaction_metrics_observer.h +++ b/src/mongo/db/transaction_metrics_observer.h @@ -67,27 +67,40 @@ public: unsigned long long curTime); /** - * Updates relevant metrics when a transaction commits. + * Updates relevant metrics when a transaction commits. Also removes this transaction's oldest + * oplog entry Timestamp from the oldestActiveOplogEntryTS set if it is not boost::none. */ void onCommit(ServerTransactionsMetrics* serverTransactionsMetrics, unsigned long long curTime, + boost::optional<Timestamp> oldestOplogEntryTS, Top* top); /** - * Updates relevant metrics when an active transaction aborts. + * Updates relevant metrics when an active transaction aborts. Also removes this transaction's + * oldest oplog entry Timestamp from the oldestActiveOplogEntryTS set if it is not boost::none. */ void onAbortActive(ServerTransactionsMetrics* serverTransactionsMetrics, unsigned long long curTime, + boost::optional<Timestamp> oldestOplogEntryTS, Top* top); /** - * Updates relevant metrics when an inactive transaction aborts. + * Updates relevant metrics when an inactive transaction aborts. Also removes this transaction's + * oldest oplog entry Timestamp from the oldestActiveOplogEntryTS set if it is not boost::none. */ void onAbortInactive(ServerTransactionsMetrics* serverTransactionsMetrics, unsigned long long curTime, + boost::optional<Timestamp> oldestOplogEntryTS, Top* top); /** + * Adds the prepareTimestamp, which is currently the Timestamp of the first oplog entry written + * by an active transaction, to the oldestActiveOplogEntryTS set. + */ + void onPrepare(ServerTransactionsMetrics* serverTransactionsMetrics, + Timestamp prepareTimestamp); + + /** * Updates relevant metrics when an operation running on the transaction completes. An operation * may be a read/write operation, or an abort/commit command. */ |