-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
QE 2026-06-22
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Summary
Introduce the CollectionAcquirer seam used by the change-stream single-document lookup
executors to decouple "give me a CollectionAcquisition" from "take a lock". Ships both
implementations and the point-in-time read guard. No pipeline wiring yet – this is a building
block consumed by the Express executor (later in this milestone) and reused later by SBE and
$search.
Scope
- Define the CollectionAcquirer abstract interface returning a wrapped
CollectionAcquisition handle. - OnDemandCollectionAcquirer: calls acquireCollectionMaybeLockFree per call. The
acquirer the Express path uses (target nss varies per event on db/cluster streams). - PreAcquiredCollectionAcquirer: locates the upfront AcquiredCollection in
TransactionResources::acquiredCollections and wraps it with no new lock. {{tassert}}s when
the requested nss is absent from the upfront list. Propagates exists() == false as the
authoritative answer at the stream's clusterTime. Ships as the reusable building block for
$search / SBE; not wired into the pipeline here. - assertLocalLookupReadAtOrAfter() snapshot guard: reads the RU point-in-time read timestamp
and tasserts it is at or after the event's afterClusterTime. No-op for an absent or
untimestamped read.
Files
- src/mongo/db/exec/agg/single_doc_lookup/collection_acquirer.h (header-only)
- src/mongo/db/exec/agg/single_doc_lookup/BUILD.bazel
Acceptance criteria
- Both acquirers implemented behind the common interface; PreAcquired tasserts on a missing nss
and surfaces exists() == false unchanged. - assertLocalLookupReadAtOrAfter() is a no-op for an absent/untimestamped read and tasserts
otherwise. - Unit tests cover: OnDemand acquire, PreAcquired hit / miss-tassert / non-existent-collection,
and the snapshot guard.
- related to
-
SERVER-128413 Implement ExpressSingleDocumentLookupExecutor for change-stream updateLookup
-
- Closed
-