[SERVER-72985] FSM workloads which use the connection cache features should automatically opt-out of using transactions in passthroughs Created: 18/Jan/23  Updated: 29/Oct/23  Resolved: 20/Jan/23

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-71203 Test the resilience of the new movePr... Closed
Related
is related to SERVER-35037 Create new concurrency suite that run... Closed
is related to SERVER-19630 FSM tests - capability to run against... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding NYC 2023-01-23
Participants:

 Description   

concurrency*.yml test suite which set TestData.runInsideTransaction = true use withTxnAndAutoRetry() to start and automatically retry a transaction until it commits. This allows operations run by a $config.states function to implicitly be performed inside a transaction without changing the FSM workload itself.

Some FSM workloads enable the connection cache to allow reading from a secondary member of a replica set or shards and config servers in a sharded cluster. The changes from SERVER-19630 additionally made it so the operations on these other nodes in the cluster use the same underlying DriverSession object. This was motivated by wanting to ensuring causal consistency when reading from other members. However, using the same underlying DriverSession object also means the FSM workload is able to start a transaction on the config server replica set which won't automatically be committed by the withTxnAndAutoRetry() because the withTxnAndAutoRetry() function receive a DriverSession associated with a mongos connection object. And because the testing-default transaction lifetime limit is 24 hours, an FSM workload which leaks a transaction on a shard or config server will cause a timeout in Evergreen.

We should instead have any $config.states function which makes use the connection cache automatically opt-out of runnings its operations within a transaction. This sacrifices a small amount of test coverage for little effort because usage of the connection cache is uncommon in FSM workloads. (A more complete solution might be to opt-out of using transactions only for operations using connections from the connection cache. But this would require revisiting how to provide causal consistency when using the connection cache without also sharing the transaction state of the DriverSession.)



 Comments   
Comment by Githook User [ 18/Jan/23 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-72985 Avoid implicit transaction in state functions w/ connCache.

Forces a $config.states FSM function which makes use of the connection
cache feature in the concurrency framework to run outside of a
transaction.
Branch: master
https://github.com/mongodb/mongo/commit/cc58f8f410d34800f2ec2a8b9805bddd079f366a

Generated at Thu Feb 08 06:23:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.