[SERVER-35635] Use AutoGetCollection::ViewMode::kViewsPermitted when acquiring locks in DocumentSourceCursor::loadBatch() Created: 15/Jun/18  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Kyle Suarez Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: open_todo_in_code, read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-35634 view_catalog_cycle_lookup.js should n... Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 15

 Description   

After a yield, the underlying namespace may have been dropped and replaced with a view. The lock acquisition in DocumentSourceCursor::loadBatch() will then throw because AutoGetCollectionForRead defaults to prohibiting views. The throwing behavior is correct, but the message is confusing.

Instead, we could acquire locks with view mode AutoGetCollection::ViewMode::kViewsPermitted. This would allow lock acquisition in DocumentSourceCursor::loadBatch() to succeed, and then fail with a much better error message when attempting to use the PlanExecutor, which will be marked as dead because its underlying namespace was dropped.


Generated at Thu Feb 08 04:40:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.