ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Minor - P4
    • 9.1.0-rc0, 9.1.0-rc1025
    • Affects Version/s: None
    • Component/s: None
    • None
    • DB Integration & Observability
    • Fully Compatible
    • QI 2025-02-17
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Overview

      Add a regression test pinning the update event's fullDocument for updates that change the shard key, with fullDocument: "updateLookup", comparing the optimized updateLookup flag on and off.

      Background

      REP-8114 (mongosync server-side hashing) found update events whose shard key value changed arriving without a fullDocument on released 9.0.x. That is the legacy lookup's design: it matches on the event's documentKey, which holds the old shard key value, so the lookup misses. The optimized path (featureFlagChangeStreamOptimizedUpdateLookup) uses the old shard key only for the routing decision and reads by _id only, so it finds the document with its new shard-key values. No server-side test pinned this contract, which initially mis-directed the rollout investigation.

      Scope of Work

      • jstests/sharding/query/change_streams/change_stream_update_lookup_shard_key_change.js — new test (2-shard cluster, collection sharded on a: 1):
        • control update not touching the shard key → fullDocument present in both flag states
        • shard-key update a: 1 → a: 2 in a transaction → update event whose documentKey holds the old key
        • flag on: fullDocument = the full document with its new shard-key value
        • flag off: fullDocument = null

      Acceptance Criteria

      • Test passes with featureFlagChangeStreamOptimizedUpdateLookup on (default)
      • Test passes with the flag disabled at runtime (via runWithParamsAllNonConfigNodes)

      Technical Notes

      • Shard-key updates must run in a multi-statement transaction or with retryWrites: true; the test uses a transaction so it does not depend on the shell's retryable-write setting.
      • Periodic noops keep cluster time advancing so update events surface promptly on the v1 (flag-off) path.

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

              Created:
              Updated:
              Resolved: