[SERVER-58176] Mongos does not validate readConcern on insert/update/delete commands Created: 30/Jun/21 Updated: 29/Oct/23 Resolved: 15/Oct/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.0, 4.4.17, 5.0.12 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Shane Harvey | Assignee: | Jonathan Lee |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | sharding-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||
| Backport Requested: |
v5.1, v5.0, v4.4, v4.2
|
||||||||||||||||||||||||
| Sprint: | Sharding 2021-10-18 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
Mongos does not validate readConcern on insert/update/delete commands:
The same commands on mongod result in an error:
Now you might say "sure, why would it validate readConcern on a write command?" Well, drivers expose snapshot reads support through the sessions api. You can declare a session with "snapshot=True" and then all operations using that session follow the snapshot reads protocol, eg:
Drivers would like any operation that doesn't support readConcern.level=snapshot to error. For example, write commands (insert, update, delete, findAndModify, etc) and unsupported read operations like listCollections should error. The plan is to send readConcern.level snapshot with all commands in a snapshot session and rely on the server to report an error when that particular command is not supported. This plan only works if Mongos consistently validates readConcern on all commands (like mongod). |
| Comments |
| Comment by Githook User [ 17/Aug/22 ] |
|
Author: {'name': 'Erin Liang', 'email': 'erin.liang@mongodb.com', 'username': 'erl-ang'}Message: |
| Comment by Githook User [ 12/Aug/22 ] |
|
Author: {'name': 'Jonathan Lee', 'email': 'jonathan.lee@mongodb.com', 'username': 'jonatlee'}Message: (cherry picked from commit db3f81f7f409688b537ccdcf0d7212a8fd7c5d2c) |
| Comment by Githook User [ 15/Oct/21 ] |
|
Author: {'name': 'Jonathan Lee', 'email': 'jonathan.lee@mongodb.com', 'username': 'jonatlee'}Message: |
| Comment by Shane Harvey [ 05/Oct/21 ] |
|
Thanks cheahuychou.mao. As far as drivers are concerned for this ticket, we only care that insert/update/delete commands error when readConcern level "snapshot" is provided. |