ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.1.0-rc1026
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • QI 2025-02-17
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Extract the randomized graph walk of ShardingCommandGenerator into a model-agnostic base class, so a transaction-centric generator can subclass it instead of copying ~200 lines of walk.

      Scope of Work

      • Create jstests/libs/util/change_stream/change_stream_fsm_command_generator.js — FsmCommandGenerator: constructor(seed)/getSeed(), generateCommands(model, params) (BFS all-pairs shortest paths precompute, unvisited-edge iteration: random unvisited self-loops first, then non-self-loops, then BFS to the nearest state with unvisited edges), and the hook interface _initialContextForState / _commandsForAction / _updateContextForAction / _finalCommands. Hooks RETURN commands; the base owns the flat list; context is mutated in place.
      • Modify jstests/libs/util/change_stream/change_stream_sharding_command_generator.js — extend the base, wire the three hooks to the existing sharding methods, delete the moved walk methods.

      Constraints

      • This is a behavior-preserving refactor and the riskiest change of the effort: the walk body moves VERBATIM — no edits to BFS, unvisited tracking, random selection, or navigation order.
      • Nothing else ships in this change: no txn model, no new tests. It must "just work".

      Acceptance Criteria

      • Golden sequences (generated command lists for fixed seeds, e.g. 42/43/44) are byte-identical before and after.
      • change_streams_sharding_command_generator suite passes.
      • One end-to-end change_streams_sharding_fsm variant passes

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

              Created:
              Updated:
              Resolved: