[SERVER-22284] Executing a read concern query after connecting with the shell throws error Created: 22/Jan/16  Updated: 08/Feb/16  Resolved: 08/Feb/16

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.2.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kelsey Schubert Assignee: David Storch
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-22440 Shell incorrectly issues first query ... Closed
Operating System: ALL
Steps To Reproduce:

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

Participants:

 Description   

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> 



 Comments   
Comment by David Storch [ 08/Feb/16 ]

Closing as a duplicate of SERVER-22440.

Comment by Kelsey Schubert [ 22/Jan/16 ]

milkie, that's right.

Also, if you use a shell from 3.2.1 to connect to a 3.2.0 mongod you can observe this issue.

Comment by Eric Milkie [ 22/Jan/16 ]

From the description, I assume this means if you use a shell from 3.2.0 to connect to a 3.2.1 mongod, the problem does not occur?

Generated at Thu Feb 08 03:59:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.