[CDRIVER-2650] "find" command for mongos can include readConcern twice Created: 14/May/18  Updated: 28/Oct/23  Resolved: 15/Jun/18

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.11.0

Type: Bug Priority: Trivial - P5
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When we query mongos 3.2 or 3.4 with a read preference and read concern, the command should be assembled like:

{
  "$query": {
    "find": "test", "filter": {}, "readConcern": {"level": "majority"}
  },
  "$readPreference": {
    "mode": "secondary"
  }
}

However, the driver sends:

{
  "$query": {
    "find": "test", "filter": {}, "readConcern": {"level": "majority"}
  },
  "$readPreference": {
    "mode": "secondary"
  },
  "readConcern": {"level": "majority"}
}

mongos apparently ignores the outer readConcern.



 Comments   
Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com'}

Message: refactor read/writeConcern handling

Fixes CDRIVER-2650: we included readConcern twice with some secondary
mongos queries. Prepares for transactions, CDRIVER-2558
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/806cddb2acde03f5462460491f38fa21332b7d97

Comment by Githook User [ 16/May/18 ]

Author:

{'email': 'jesse@mongodb.com', 'username': 'ajdavis', 'name': 'A. Jesse Jiryu Davis'}

Message: refactor read/writeConcern handling

Fixes CDRIVER-2650: we included readConcern twice with some secondary
mongos queries. Prepares for transactions, CDRIVER-2558
Branch: transactions
https://github.com/mongodb/mongo-c-driver/commit/725fc97a2064161036d3129aeecc72f24c37f5ec

Generated at Wed Feb 07 21:15:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.