Sharded transactions do not support readConcern local

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.1.6
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Hide
      var session = db.getMongo().startSession()
      session.startTransaction({readConcern:{level:"local"}})
      session.getDatabase("test").test.insertOne({})
      
      Show
      var session = db.getMongo().startSession() session.startTransaction({readConcern:{level: "local" }}) session.getDatabase( "test" ).test.insertOne({})
    • Sharding 2018-12-03
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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"?

            Assignee:
            Jack Mulrow
            Reporter:
            Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: