[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: |
|
||||||||||||||||||||||||
| 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: (cherry picked from commit 29c8f66e4396c7b68535d644638f2a81592e3081) |
| Comment by Githook User [ 24/May/18 ] |
|
Author: {'username': 'guoyr', 'name': 'Robert Guo', 'email': 'robert.guo@10gen.com'}Message: |
| Comment by Robert Guo (Inactive) [ 05/Apr/18 ] |
|
milkie I think this ticket is only useful for running existing workloads through the shell. |
| 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. |