[SERVER-41269] Set txn state to in-progress when fetching active transaction state Created: 22/May/19  Updated: 29/Oct/23  Resolved: 30/May/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.1.14

Type: Bug Priority: Major - P3
Reporter: Jason Chan Assignee: Siyuan Zhou
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-40919 Remove usages of the stmtId field for... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2019-06-03
Participants:

 Description   

Currently, when fetching an active transaction, we don't set the result.state for in-progress transactions. This can be a problem for when we abort transactions on step-up. In that situation, we get the state of the ActiveTransactionHistory to be kNone which will cause the txn state to be set to kExecutableRetryableWrite.

This can cause problems where we don't log metrics for transactions since the participant thinks it is a retryable write.

Additionally, when this is fixed, it is possible to trigger an invariant in scenarios like in abort_in_progress_transactions_on_step_up.js. In this test, a node steps up from secondary to primary with an in-progress transaction already in place. This transaction was replicated from the last primary, and the node knows to abort it. However, in scenarios where the transaction is slow, we will try to log that transaction metric and hit the invariant since the startTime was never set on the secondary.



 Comments   
Comment by Githook User [ 30/May/19 ]

Author:

{'email': 'siyuan.zhou@mongodb.com', 'name': 'Siyuan Zhou', 'username': 'visualzhou'}

Message: SERVER-41269 Set txn state to in-progress when fetching active transaction state
Branch: master
https://github.com/mongodb/mongo/commit/5c2ca8167e61c69b2f88f179f53f829243f33759

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