Implement ShardedClusterLocalLookupEligibility for sharded change-stream updateLookup

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • QE 2026-06-22, QE 2026-07-06
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Add the sharded-cluster local-lookup eligibility used by the change-stream updateLookup single-document lookup chain. For each change event it decides whether this shard owns the event's documentKey, so the post-image can be read locally instead of routed to another shard.

      What

      • ShardedClusterLocalLookupEligibility(localShardId) implementing the LocalLookupEligibility::run(expCtx, nss, documentKey, body) interface.
      • run() drives the lookup body through CollectionRouter::route(), so a StaleConfig raised by the body's versioned local read is refreshed and retried by the router.
      • A pure decision function over the routed CollectionRoutingInfo: it targets the documentKey with the simple collation and returns Local with the shard version when this shard solely owns the chunk, Local with an untracked shard version plus the database version for an untracked collection on this primary, and Unknown otherwise (remote, multi-shard, or any routing or targeting failure).
      • Placed in its own build target so the base eligibility (the interface plus the always-local and always-unknown implementations) does not pull in the router, grid, or shard-targeting libraries.

      Acceptance

      • Unit tests cover the decision table (owned by this shard, owned by another shard, untracked collection on this primary, and a documentKey that does not cover the shard key) using mocked routing info.

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

              Created:
              Updated: