Implement ExpressSingleDocumentLookupExecutor for change-stream updateLookup

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • QE 2026-06-22
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      Implement the Express single-document lookup executor: a per-call _id-equality local point
      lookup that serves the change-stream updateLookup against the user collection, declining
      (kNotHandled) to the Aggregation fallback when the lookup is not provably local. No production
      wiring here – wiring lands in a follow-up ticket.

      Scope

      • ExpressSingleDocumentLookupExecutor implementing SingleDocumentLookupExecutor
        (SERVER-128408).
      • Eligibility-gated cheap decline: on an Unknown decision, return kNotHandled before any
        collection acquisition or plan build.
      • Build a fresh executor per call via the existing public makeExpressExecutorForFindById /
        makeExpressExecutorForFindByClusteredId (from plan_executor_express.h), choosing the
        variant from the live collection layout.
      • _id-only seek: strip any shard-key fields a sharded documentKey carries before building the
        find. Correct because _id is unique per shard and the read is local and versioned.
      • Exception handling: StaleConfig / StaleDbVersion / ShardCannotRefreshDueToLocksHeld
        invalidate as appropriate and return kNotHandled; NamespaceNotFound /
        CollectionUUIDMismatch return kHandledNotFound; anything else propagates.
      • Call assertLocalLookupReadAtOrAfter() (SERVER-128411) after acquisition for point-in-time
        correctness.
      • Acquirer-agnostic: holds the polymorphic CollectionAcquirer base.

      Files

      • src/mongo/db/exec/agg/single_doc_lookup/express_single_document_lookup_executor.h / .cpp
      • src/mongo/db/exec/agg/single_doc_lookup/single_document_lookup_executor_test.cpp (executor matrix)

      Acceptance criteria

      • All paths of the exception handling covered by unit tests, parameterised over the eligibility
        mock.
      • A multi-field (sharded) documentKey is served by matching _id alone (kHandledFound), not
        declined for being sharded; a stale shard-key value in the documentKey is ignored.
      • Cheap-decline verified: an Unknown decision returns kNotHandled with no acquisition.

      Dependencies

      Depends on SERVER-128408 (interface), SERVER-128411 (acquirer), SERVER-128412 (eligibility).

            Assignee:
            Denis Grebennicov
            Reporter:
            Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: