-
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
Add the SingleDocumentLookupExecutor abstraction that change-stream lookup strategies will implement, plus the PrimaryWithFallbackSingleDocumentLookupExecutor combinator that composes a primary strategy with a universal fallback. Interface and test mock only; no production wiring in this ticket.
Scope
- SingleDocumentLookupExecutor abstract base in src/mongo/db/exec/agg/single_doc_lookup/single_document_lookup_executor.h (header-only target, no SBE symbols).
- A three-state LookupResult with values kNotHandled, kHandledNotFound, kHandledFound.
- performLookup(expCtx, nss, collectionUUID, documentKey, afterClusterTime), where the last argument is boost::optional<Timestamp> (the event clusterTime, not a prebuilt readConcern).
- detachFromOperationContext() / reattachToOperationContext() lifecycle hooks.
- PrimaryWithFallbackSingleDocumentLookupExecutor: calls the primary; on kNotHandled it calls the fallback exactly once with identical arguments; forwards detach/reattach to both children.
- A test-only mock executor.
Acceptance criteria
- Unit tests for chain dispatch:
- kHandledFound / kHandledNotFound return immediately; fallback not invoked.
- kNotHandled invokes the fallback exactly once with the same arguments.
- detach/reattach forwarded to both primary and fallback.
- No production callsite wired.
- related to
-
SERVER-128409 Implement AggregationSingleDocumentLookupExecutor (routed fallback)
-
- Closed
-
-
SERVER-128410 Route ChangeStreamUpdateLookupStage through SingleDocumentLookupExecutor (Aggregation-only)
-
- Closed
-
-
SERVER-128413 Implement ExpressSingleDocumentLookupExecutor for change-stream updateLookup
-
- Closed
-