[SERVER-77508] ReadConcern isn't propagated to DBDirectClient Created: 26/May/23 Updated: 29/Oct/23 Resolved: 30/May/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jordi Olivares Provencio | Assignee: | Jordi Olivares Provencio |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Execution Team 2023-05-29, Execution Team 2023-06-12 | ||||||||
| Participants: | |||||||||
| Description |
|
Currently DBDirectClient doesn't propagate the read concern used by the parent operation into DBDirectClient. This can be reproduced by performing a find operation with a $where clause. The command performs a DBDirectClient::find call to the system.js collection. Adding logging statements to get the operation read concern at the beginning of the find command shows this:
This can lead to potentially invalid reads performed by DBDirectClient. |
| Comments |
| Comment by Githook User [ 30/May/23 ] |
|
Author: {'name': 'Jordi Olivares Provencio', 'email': 'jordi.olivares-provencio@mongodb.com', 'username': 'jordiolivares'}Message: |
| Comment by Jordi Olivares Provencio [ 26/May/23 ] |
|
Sure, this shouldn't be difficult as it's just touching this branch |
| Comment by Max Hirschhorn [ 26/May/23 ] |
|
Thanks for confirming jordi.olivares-provencio@mongodb.com! Can we make it so ServiceEntryPoint (or wherever) skips updating the ReadConcernArgs decoration when parsing a command issued with DBDirectClient? It seems incorrect that using DBDirectClient changes the decorations on the OperationContext because it is meant to be sharing the values with the parent operation. |
| Comment by Jordi Olivares Provencio [ 26/May/23 ] |
|
max.hirschhorn@mongodb.com That's precisely what's happening. The new command gets parsed and resets the ReadConcernArgs on the parent's opCtx. |
| Comment by Max Hirschhorn [ 26/May/23 ] |
|
jordi.olivares-provencio@mongodb.com, would you please elaborate on why the read concern needs to be propagated to the DBDirectClient? My understanding is DBDirectClient is using the same OperationContext as the parent operation and therefore already inherits the value of the ReadConcernArgs decoration on the OperationContext. Is the "opCtx level comand start" log output you've shared showing that the ReadConcernArgs decoration is having its value reset when the DBDirectClient command is being run? |