[SERVER-38122] Sharded transactions do not support readConcern local Created: 14/Nov/18  Updated: 29/Oct/23  Resolved: 20/Nov/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.1.6

Type: Bug Priority: Major - P3
Reporter: Shane Harvey Assignee: Jack Mulrow
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

var session = db.getMongo().startSession()
session.startTransaction({readConcern:{level:"local"}})
session.getDatabase("test").test.insertOne({})

Sprint: Sharding 2018-12-03
Participants:

 Description   

Attempting to start a sharded transaction on server version 4.1.5 with readConcern level "local" results in the following error:
"The first command in a transaction cannot specify a readConcern level other than snapshot or majority"

MongoDB Enterprise mongos> session = db.getMongo().startSession()
session { "id" : UUID("598f8543-7697-4822-bf6d-7f78b82cd00e") }
MongoDB Enterprise mongos> session.startTransaction({readConcern:{level:"local"}})
MongoDB Enterprise mongos> session.getDatabase("test").test.insert({})
WriteCommandError({
	"ok" : 0,
	"errmsg" : "The first command in a transaction cannot specify a readConcern level other than snapshot or majority",
	"code" : 72,
	"codeName" : "InvalidOptions",
	"operationTime" : Timestamp(1542158775, 2),
	"$clusterTime" : {
		"clusterTime" : Timestamp(1542158775, 2),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	}
})

I thought the server was free to upgrade a user's readConcern from a lower level to a higher level. Are we going to support this in 4.2 or will mongos always reject "local"?



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

Author:

{'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}

Message: SERVER-38122 Support read concern level local in sharded transactions
Branch: master
https://github.com/mongodb/mongo/commit/0945e6c3906a7fd9c07b0add771f7b263647db63

Comment by Andy Schwerin [ 14/Nov/18 ]

This is a true bug, shane.harvey. We'll need to fix it for 4.2.

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