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

3.7 sharded clusters ignore create command write concern

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.7.3
    • Sharding
    • None
    • ALL

    Description

      Sending the create command with a nonsensical write concern to a 3.7 replica set with three members results in a write concern error:

      >>> c = pymongo.MongoClient()
      >>> c.foo.command('create', 'bar', writeConcern={'w': 1000})
      {'ok': 1.0, 'operationTime': Timestamp(1518570804, 1), 'writeConcernError': {'codeName': 'CannotSatisfyWriteConcern', 'errmsg': 'Not enough data-bearing nodes', 'code': 100}, '$clusterTime': {'signature': {'keyId': 0, 'hash': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'}, 'clusterTime': Timestamp(1518570804, 1)}}
      >>> c.admin.command('buildInfo')['version']
      '3.7.1-370-gfab8bda846'
      

      Sending the same command to a mongos in front of a single three member shard does not cause a write concern error:

      >>> c = pymongo.MongoClient()
      >>> c.foo.command('create', 'bar', writeConcern={'w': 1000})
      {'ok': 1.0, '$clusterTime': {'signature': {'keyId': 0, 'hash': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'}, 'clusterTime': Timestamp(1518571939, 3)}, 'operationTime': Timestamp(1518571939, 2)}
      >>> c.admin.command('buildInfo')['version']
      '3.7.1-370-gfab8bda846'
      

      Attachments

        Activity

          People

            randolph@mongodb.com Randolph Tan
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: