[SERVER-33738] Create a runCommand() override method to perform operations inside a transaction Created: 08/Mar/18  Updated: 29/Oct/23  Resolved: 24/May/18

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.0.0-rc1, 4.1.1

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Robert Guo (Inactive)
Resolution: Fixed Votes: 0
Labels: tig-skip-pointing
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Gantt Dependency
has to be done before SERVER-35089 Investigate additional failures in th... Closed
Related
related to SERVER-34772 Read concern snapshot should prohibit... Closed
related to SERVER-34774 Converting an index to multikey is no... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: TIG 2018-03-26, TIG 2018-04-09, TIG 2018-04-23, TIG 2018-05-07, TIG 2018-05-21, TIG 2018-06-04
Participants:

 Description   

The override should make it so that consecutive "insert", "update", "delete", "findAndModify" / "findandmodify", "find", and "getMore" commands occur in the same transaction by specifying autocommit=false and using the same txnNumber. The "commitTransaction" command should be executed when there's an uncommitted transaction associated with the session and Mongo.prototype.runCommand() is called for any other command.

In order to handle the case where the last statement executed by the JavaScript test performs a command supported by multi-statement transactions, the test should be executed via a static JavaScript runner file that users a call to load() to execute the actual test and has a command such as "ping" run afterwards in order to commit the uncommitted transaction.



 Comments   
Comment by Judah Schvimer [ 07/Feb/19 ]

william.schultz, I think that is a good idea in general for test suite config files.

Comment by William Schultz (Inactive) [ 06/Feb/19 ]

I can probably just add such a comment myself.

Comment by William Schultz (Inactive) [ 06/Feb/19 ]

robert.guo In reviewing the various transactions related test suites, I noticed that replica_sets_multi_stmt_txn_jscore_passthrough.yml doesn't have a comment at the top of the YAML suite file describing what the test suite does. I think it would be helpful to add a short comment, since it is becoming harder to keep track of all our various passthrough suites and how they override and modify default behaviors. Would you recommend I file a ticket for this or is this something that could maybe be done as an auxiliary change as part of some other work?

Comment by Githook User [ 24/May/18 ]

Author:

{'username': 'guoyr', 'name': 'Robert Guo', 'email': 'robert.guo@10gen.com'}

Message: SERVER-33738 Create a runCommand() override method to perform operations inside a transaction

(cherry picked from commit 29c8f66e4396c7b68535d644638f2a81592e3081)
Branch: v4.0
https://github.com/mongodb/mongo/commit/3ae0777cfe3e467df6edafd1af6d8d64c4bc93db

Comment by Githook User [ 24/May/18 ]

Author:

{'username': 'guoyr', 'name': 'Robert Guo', 'email': 'robert.guo@10gen.com'}

Message: SERVER-33738 Create a runCommand() override method to perform operations inside a transaction
Branch: master
https://github.com/mongodb/mongo/commit/29c8f66e4396c7b68535d644638f2a81592e3081

Comment by Robert Guo (Inactive) [ 05/Apr/18 ]

milkie I think this ticket is only useful for running existing workloads through the shell. SERVER-33218 is intended to provide the public shell API for multi-document transactions. If you think there's value in this ticket beyond SERVER-33218 for end users, let me know; I'd be interested in making it more publicly visible.

Comment by Eric Milkie [ 03/Apr/18 ]

Would this override be of value to external users? The syntax is pretty friendly for someone trying to build up a multi-document transaction in the shell.

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