[SERVER-34288] Allow abortTransaction or commitTransaction as first statement in transaction Created: 03/Apr/18  Updated: 29/Oct/23  Resolved: 20/Apr/18

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

Type: Improvement Priority: Major - P3
Reporter: Xiangyu Yao (Inactive) Assignee: Pavithra Vetriselvan
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-34094 Change snapshot read tests to use mul... Closed
is depended on by SERVER-34388 Continue converting snapshot reads te... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-04-23, Repl 2018-05-07
Participants:

 Description   

session.startTransaction({readConcern: {level: "snapshot"}})
session.abortTransaction()

[js] Error: command failed: {
        "operationTime" : Timestamp(1522790291, 1),
        "ok" : 0,
        "errmsg" : "Command does not support read concern { readConcern: { level: \"snapshot\" } }",
        "code" : 72,
        "codeName" : "InvalidOptions",
        "$clusterTime" : {
                "clusterTime" : Timestamp(1522790291, 1),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        }
} :



 Comments   
Comment by Githook User [ 20/Apr/18 ]

Author:

{'email': 'pvselvan@umich.edu', 'username': 'pvselvan', 'name': 'Pavi Vetriselvan'}

Message: SERVER-34288 Allow abortTransaction and commitTransaction as the first statement
Branch: master
https://github.com/mongodb/mongo/commit/34f5e2f899ede8f011ff844e8075f72197ff14d7

Comment by Shane Harvey [ 12/Apr/18 ]

The abortTransaction should be a no-op in this case because no operations have been performed in the transaction:

session.startTransaction({readConcern: {level: "snapshot"}})
session.abortTransaction()  // No command is run. session is no longer in a transaction.

Comment by Spencer Brody (Inactive) [ 03/Apr/18 ]

This seems likely to be a problem with the shell helpers, not the server behavior.

Comment by Xiangyu Yao (Inactive) [ 03/Apr/18 ]

In SERVER-34094, I already added TODOs with this SERVER ticket number in some jstests so that we could remember all the places where we should pair startTransaction() with abortTransaction().

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