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

XMLWordPrintableJSON

    • Query Execution
    • Fully Compatible
    • 15
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:
              [DO NOT USE] Backlog - Query Execution
              Reporter:
              Kyle Suarez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: