[SERVER-36501] serverStatus support for prepared transactions Created: 07/Aug/18  Updated: 29/Oct/23  Resolved: 06/Nov/18

Status: Closed
Project: Core Server
Component/s: Diagnostics, Replication
Affects Version/s: None
Fix Version/s: 4.1.5

Type: Task Priority: Major - P3
Reporter: Judah Schvimer Assignee: Jason Chan
Resolution: Fixed Votes: 0
Labels: prepare_diagnostics
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-36489 Start initial sync oplog fetching fro... Closed
Documented
is documented by DOCS-12189 Docs for SERVER-36501: serverStatus s... Closed
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-10-22, Repl 2018-11-05, Repl 2018-11-19
Participants:
Linked BF Score: 0

 Description   

Similar to the transactions diagnostics project, we want to maintain certain metrics in the serverStatus section. The TransactionsSSS::generateSection method returns a BSON object that goes into the transactions section of the serverStatus output.

This ticket can be split into multiple commits if needed. We will want to output:

  • the total number of prepared transactions
  • the total number of committed prepared transactions
  • the total number of aborted prepared transactions

We will need to add these counters to ServerTransactionMetrics and the transactions_stats.idl class, so that we can serialize these counters to the serverStatus output object in the TransactionsSSS::generateSection method.

We will also update the TransactionMetricsObserver to increment/decrement the stats when appropriate.



 Comments   
Comment by Githook User [ 06/Nov/18 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com'}

Message: SERVER-36501 Add 'currentPrepared' metric to serverStatus
Branch: master
https://github.com/mongodb/mongo/commit/a090ee789498e709eef4c2d28bc1326070c1e67a

Comment by Githook User [ 01/Nov/18 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com'}

Message: SERVER-36501 Remove unused variables in prepared txns metrics unittests
Branch: master
https://github.com/mongodb/mongo/commit/838700e1eaa85123cf595317e0f30a1a35cc613b

Comment by Githook User [ 01/Nov/18 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com'}

Message: SERVER-36501 Add getPreparedDuration metric reporting
Branch: master
https://github.com/mongodb/mongo/commit/7ef6831a7470ec9ad85b7c4064a22d762be1d2b8

Comment by Githook User [ 01/Nov/18 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com'}

Message: SERVER-36501 serverStatus support for prepared transactions
Branch: master
https://github.com/mongodb/mongo/commit/970b1de0ec350ec5487fb230391c7bae33dd0fc2

Comment by Judah Schvimer [ 19/Oct/18 ]

Great, I agree with Will. Also can this ticket please add the "oldest active transaction timestamp" (from SERVER-35873) to server status? I don't think it's currently included.

Comment by Pavithra Vetriselvan [ 19/Oct/18 ]

I agree with Will that it'd be nice to keep the naming consistent between 4.0 and 4.2. So would mean that the existing fields (currentActive, currentOpen, etc) would encompass prepared and unprepared transactions?

Comment by William Schultz (Inactive) [ 19/Oct/18 ]

For sake of consistency between 4.0 and 4.2, I don't think we should change the existing metrics. For example, if someone is using a 4.2 replica set to run non-sharded transactions, I feel that it would be nice if the metrics appear the same as in 4.0 (ignoring any added fields). The definition of totalCommitted can remain the same, and totalPreparedAndThenCommitted will assume the new, appropriate meaning. Like you said, you can derive the value of totalUnpreparedAndThenCommitted from the other two.

Alternatively, we could have 3 fields: totalCommitted, totalPreparedAndThenCommitted, totalUnpreparedAndThenCommitted, but that feels a bit overkill.

Comment by Judah Schvimer [ 19/Oct/18 ]

pavithra.vetriselvan and jason.chan, do you think we want to change the current metrics to "committed unprepared transactions" etc., or just have readers do subtraction if they care? CC william.schultz kelsey.schubert

Comment by Judah Schvimer [ 04/Oct/18 ]

pavithra.vetriselvan, can you please fill the description of this ticket in with what work needs to be done?

Generated at Thu Feb 08 04:43:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.