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

Replace SBE's CollectionRef with Shard Role acquisitions

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing

      SBE currently performs the following process for using collections:

      • Acquire the collections at the command layer. This internally either locks the collections or performs a lock-free read.
      • Create the query execution plan.
      • At query execution time lookup the collection from the catalog and refresh it on every yield. This is done via CollectionRef.

      This is essentially a reimplementation of yielding and requires manual catalog refreshes which is prone to bugs of not having a consistent collection with the underlying WT snapshot if we forget to make the call to CollectionCatalog::establishConsistentCollection after a yield. Instead the SBE plans should hold a CollectionAcquisition itself rather than doing manual catalog lookups

      Right now this is safe to do in terms of locking since we hold a lock on the collection and that is managed by normal yielding of the Locker. However, secondary collections are not established as consistent if using the old AutoGetCollectionForReadLockFree class so even the first acquisition might not be in sync with the snapshot.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: