[SERVER-34051] Require autocommit:false on all operations as part of an ongoing transaction Created: 21/Mar/18  Updated: 29/Oct/23  Resolved: 04/Apr/18

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

Type: Task Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: William Schultz (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File abort_txn.js    
Issue Links:
Duplicate
is duplicated by SERVER-34013 Require autocommit:false be provided ... Closed
Related
related to SERVER-34052 Require 'startTransaction':true on fi... Closed
is related to SERVER-34059 DuplicateKeyError aborts transaction Closed
is related to SERVER-33412 Error on writes with unsupported tran... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-04-09
Participants:

 Description   

This is necessary to distinguish individual operations within an ongoing transaction from single-statement retryable writes



 Comments   
Comment by A. Jesse Jiryu Davis [ 05/Apr/18 ]

OK, that could be true - the driver ignores errors from abortTransaction so I didn't understand what was happening. In that case I'm alright with requiring autocommit: false for both. shane.harvey what do you think? I expect you agree.

spencer could you please update your "Design: Single Replica Set Transactions" doc with the new protocol?

Comment by William Schultz (Inactive) [ 05/Apr/18 ]

Um, that doesn't sound correct. Both commitTransaction and abortTransaction MUST have autocommit:false set in order to succeed. See repro for abortTransaction. abort_txn.js

Comment by A. Jesse Jiryu Davis [ 05/Apr/18 ]

It appears that abortTransaction neither requires nor prohibits autocommit: false but commitTransaction requires it: "Must specify autocommit=false on all operations of a multi-statement transaction", error code 72. I propose that commitTransaction also shouldn't require or prohibit autocommit: false.

Comment by William Schultz (Inactive) [ 04/Apr/18 ]

Ah, you are so right. That's my bad. I have gotten so used to clicking "Not Needed". Thanks for fixing it.

Comment by Githook User [ 04/Apr/18 ]

Author:

{'email': 'william.schultz@mongodb.com', 'name': 'William Schultz', 'username': 'will62794'}

Message: SERVER-34051 Require autocommit=false on all transaction operations and add support
for 'startTransaction' argument

This patch requires all operations that are part of a multi-statement transaction to
specify an autocommit=false command argument. It also adds the 'startTransaction'
command argument, which when specified as 'true' indicates that a command is
the beginning of a multi-statement transaction.
Branch: master
https://github.com/mongodb/mongo/commit/66c537372c0aa54819adb7f72c9eda6cf8750f8e

Comment by Spencer Brody (Inactive) [ 23/Mar/18 ]

As part of this, if a command is received with autocommit:false, without 'startTransaction', and there is no matching transactionId in the server, we should return a NoSuchTransaction error

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