Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-38122

Sharded transactions do not support readConcern local

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.6
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      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({})
    • Sprint:
      Sharding 2018-12-03

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

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: