[SERVER-77631] Break up changeReadSourceIfNeeded into shouldReadAtLastApplied and changeReadSource Created: 31/May/23 Updated: 25/Jan/24 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Daniel Gomez Ferro | Assignee: | Backlog - Catalog and Routing |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | PM-2144-StorEx-Cleanup, car-qw | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Catalog and Routing
|
| Participants: | |
| Story Points: | 2 |
| Description |
|
SnapshotHelper::changeReadSourceIfNeeded checks whether we should read at lastApplied based on some global context and the NSS we are acquiring, then performs that change if needed. In the new API we can acquire multiple collections at once, we should first check whether we should read at last applied based on the global context, then make sure all NSSs we are acquiring are compatible with last applied, and lastly make the change. |
| Comments |
| Comment by Daniel Gomez Ferro [ 13/Jun/23 ] |
|
Nothing bad should happen immediately, but this is tech-debt. The current code in SnapshotHelper::changeReadSourceIfNeeded processes one NSS at once, checking whether we are allowed to change the read source, if we should change it and then making the change. Since we can acquire multiple collections at once now, we should should refactor the logic to handle all NSSs at once instead of performing redundant checks for every NSSs and possibly going back and forth on whether to change the readsource or not. |
| Comment by Kaloian Manassiev [ 13/Jun/23 ] |
|
daniel.gomezferro@mongodb.com, henrik.edin@mongodb.com, can you guys write some evaluation of what happens if we don't do this? Basically looking for next steps of what needs to happen here. |