Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-35635

Use AutoGetCollection::ViewMode::kViewsPermitted when acquiring locks in DocumentSourceCursor::loadBatch()

    • Query Execution
    • Fully Compatible
    • 15

      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.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: