summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction_metrics_observer.h
diff options
context:
space:
mode:
authorPavi Vetriselvan <pvselvan@umich.edu>2018-10-30 14:45:38 -0400
committerPavi Vetriselvan <pvselvan@umich.edu>2018-10-30 14:52:19 -0400
commit33ac1afd4079e04d12554f9b79d1ab07426caf59 (patch)
treee18f05ce76cec36901b76ed4cf8f6ba2ba97fb99 /src/mongo/db/transaction_metrics_observer.h
parent6d475fdb5a76acab760ce4b6709b60a4c8c9aec6 (diff)
downloadmongo-33ac1afd4079e04d12554f9b79d1ab07426caf59.tar.gz
SERVER-35811 pin stable timestamp behind oldest uncommitted timestamp
Diffstat (limited to 'src/mongo/db/transaction_metrics_observer.h')
-rw-r--r--src/mongo/db/transaction_metrics_observer.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/mongo/db/transaction_metrics_observer.h b/src/mongo/db/transaction_metrics_observer.h
index d1a3bba4244..715aa14244f 100644
--- a/src/mongo/db/transaction_metrics_observer.h
+++ b/src/mongo/db/transaction_metrics_observer.h
@@ -70,37 +70,46 @@ public:
/**
* 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.
+ * oplog entry OpTime from the oldestActiveOplogEntryOpTimes set if it is not boost::none.
+ * Finally, updates an entry in oldestNonMajorityCommittedOpTimes to include its commit OpTime.
*/
void onCommit(ServerTransactionsMetrics* serverTransactionsMetrics,
TickSource* tickSource,
- boost::optional<Timestamp> oldestOplogEntryTS,
+ boost::optional<repl::OpTime> oldestOplogEntryOpTime,
+ boost::optional<repl::OpTime> commitOpTime,
Top* top);
/**
* 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.
+ * oldest oplog entry OpTime from the oldestActiveOplogEntryOpTimes set if it is not
+ * boost::none.
+ * Finally, updates an entry in oldestNonMajorityCommittedOpTimes to include its abort OpTime.
*/
void onAbortActive(ServerTransactionsMetrics* serverTransactionsMetrics,
TickSource* tickSource,
- boost::optional<Timestamp> oldestOplogEntryTS,
+ boost::optional<repl::OpTime> oldestOplogEntryOpTime,
+ boost::optional<repl::OpTime> abortOpTime,
Top* top);
/**
* 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.
+ * oldest oplog entry OpTime from the oldestActiveOplogEntryOpTimes set if it is not
+ * boost::none.
+ * Does not accept an optional abortOpTime parameter because we cannot abort an inactive
+ * prepared transaction. Instead, uses boost::none as the abortOpTime, which subsequently will
+ * not modify oldestNonMajorityCommittedOpTimes.
*/
void onAbortInactive(ServerTransactionsMetrics* serverTransactionsMetrics,
TickSource* tickSource,
- boost::optional<Timestamp> oldestOplogEntryTS,
+ boost::optional<repl::OpTime> oldestOplogEntryOpTime,
Top* top);
/**
- * Adds the prepareTimestamp, which is currently the Timestamp of the first oplog entry written
- * by an active transaction, to the oldestActiveOplogEntryTS set.
+ * Adds the prepareOpTime, 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);
+ repl::OpTime prepareOpTime);
/**
* Updates relevant metrics when an operation running on the transaction completes. An operation