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

Executing a read concern query after connecting with the shell throws error

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.1
    • Component/s: Shell
    • None
    • ALL
    • Hide

      start new replicaset with --enableMajorityReadConcern
      connect to shell
      execute db.blah.find({}).readConcern("majority") twice

      Show
      start new replicaset with --enableMajorityReadConcern connect to shell execute db.blah.find({}).readConcern("majority") twice

      This behavior was introduced in MongoDB shell version 3.2.1

      If the first command after connecting with the shell is a read concern query, the shell throws Error: readConcern requires use of read commands.

      Subsequent queries complete successfully.

      MongoDB shell version: 3.2.1
      connecting to: test
      Server has startup warnings: 
      2016-01-22T15:45:26.193-0500 I CONTROL  [initandlisten] 
      2016-01-22T15:45:26.193-0500 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
      replset:PRIMARY> db.blah.find({}).readConcern("majority")
      Error: readConcern requires use of read commands
      replset:PRIMARY> db.blah.find({}).readConcern("majority")
      replset:PRIMARY> 
      

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: