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

Mongos does not apply commitTransaction's writeConcern

    • Fully Compatible
    • ALL
    • Hide
      from pymongo import MongoClient, WriteConcern
      client = MongoClient()
      client.t.t.insert_one({}) # Create collection
      with client.start_session() as s, s.start_transaction(write_concern=WriteConcern(w="foo")):
          client.t.t.insert_one({}, session=s)
      
      Show
      from pymongo import MongoClient, WriteConcern client = MongoClient() client.t.t.insert_one({}) # Create collection with client.start_session() as s, s.start_transaction(write_concern=WriteConcern(w= "foo" )): client.t.t.insert_one({}, session=s)
    • Sharding 2018-12-17

      Mongos seems to ignore the user's writeConcern on commitTransaction. For example:

      01 Oct 18 15:00 -0700 (Connection: 1:890886553)  op_msg commitTransaction admin Request:{"sections":[{"payload":{"$clusterTime":{"clusterTime":{"$timestamp":{"t":1538431201,"i":1}},"signature":{"hash":{"$binary":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","$type":"00"},"keyId":{"$numberLong":"0"}}},"$db":"admin","$readPreference":{"mode":"primary"},"autocommit":false,"commitTransaction":1,"lsid":{"id":{"$binary":"aK08elgGS0yy+LqHWjEHQQ==","$type":"04"}},"txnNumber":{"$numberLong":"4"},"writeConcern":{"w":"foo"}},"payloadType":0}]}
      
      
      01 Oct 18 15:00 -0700 (Connection: 1:890886553) +955µs op_msg reply   Response:{"sections":[{"payload":{"$clusterTime":{"clusterTime":{"$timestamp":{"t":1538431201,"i":2}},"signature":{"hash":{"$binary":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","$type":"00"},"keyId":{"$numberLong":"0"}}},"ok":1.0,"operationTime":{"$timestamp":{"t":1538431201,"i":2}}},"payloadType":0}]}
      

      Notice writeConcern:{w:"foo"} which should cause an unknown write concern error.

      Tested on https://github.com/mongodb/mongo/commit/860b392d9d3c006090a4c7fc3c6f3fa5460e5c5c:

      mongodb-macos-x86_64-4.1.3-233-g860b392/bin/mongos --version
      mongos version v4.1.3-233-g860b392
      git version: 860b392d9d3c006090a4c7fc3c6f3fa5460e5c5c
      allocator: system
      modules: none
      build environment:
          distarch: x86_64
          target_arch: x86_64
      

            Assignee:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: