[SERVER-36311] Add stepdowns, shutdowns, and crashes to replica_sets_multi_stmt_txn_jscore_passthrough.yml Created: 26/Jul/18  Updated: 29/Oct/23  Resolved: 15/Nov/18

Status: Closed
Project: Core Server
Component/s: Replication, Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.1.6

Type: Task Priority: Major - P3
Reporter: Judah Schvimer Assignee: Janna Golden
Resolution: Fixed Votes: 0
Labels: prepare_testing
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-37179 Wait for specified write concern when... Closed
is depended on by SERVER-37869 Add multi shard with stepdown passthr... Closed
is depended on by SERVER-37972 Create suite for running multi shard ... Closed
Related
is related to SERVER-36310 Unblacklist transactions from all jsc... Closed
is related to SERVER-38936 Create unittests for txn_override.js Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2018-08-13, Sharding 2018-08-27, Sharding 2018-09-10, Sharding 2018-09-24, Sharding 2018-10-08, Sharding 2018-10-22, Sharding 2018-11-05, Sharding 2018-11-19
Participants:

 Description   

This requires similar retryability buffering as SERVER-36310.



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

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-36311 Add stepdowns, crashes, and shutdowns to replica_sets_multi_stmt_txn_jscore_passthrough suite
Branch: master
https://github.com/mongodb/mongo/commit/dbafa9a288019008fd7a4ac975c298ec0bf40534

Comment by Max Hirschhorn [ 02/Aug/18 ]

There's a few parts to be able to retry an entire transaction in our jsCore passthroughs:

1. The auto_retry_on_network_error.js override file should be changed so that it sets a global variable (e.g. a new property called TestData.retryingOnNetworkError) that indicates a call to Mongo.prototype.runCommand() aka the clientFunction is being retried. This variable should be reset/unset when the retries are finished - either because the attempt succeeded or were exhausted.

2. The runCommandWithTransactions() function in jstests/libs/txns/txn_override.js should then check this TestData.retryingOnNetworkError flag.

  • 2a. If TestData.retryingOnNetworkError=false, then the runCommandWithTransactions() function in jstests/libs/txns/txn_override.js should append the pair of commandObj and makeFuncArgs to a private, file-scoped array (i.e. declared as let ops = [] in the immediate-invoked function expression for the module). If the transaction commits successfully, then the array should be emptied.
  • 2b. If TestData.retryingOnNetworkError=true, then the dbName, commandName, and commandObj arguments should be ignored because #2a would have ensured they were already added to the ops array. Instead, the runCommandWithTransactions() function should iterate over the commandObj and makeFuncArgs pairs and call func.apply(conn, makeFuncArgs(commandObj) on each of them. Some care will need to be taken to increment the txnNumber field in each of the stashed operations to ensure a new transaction is started on the server.

Note: The load(.../txn_override.js) call must occur before the load(.../auto_retry_on_network_error.js) call to make it so that the runWithRetriesOnNetworkErrors() function calls the runCommandWithTransactions() function. This is due to the order in which for the two override files to be able to work together must observe and redefine the Mongo.prototype.runCommand() function.

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