Refactor the analyze command into per-mode handlers with shared validation

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      analyze_cmd.cpp now has three modes (histograms, sample, NDV) with duplicated validation and plumbing. SERVER-131758 extracted the shared pieces (validateKeyPath, acquireAndValidateCollection) and made typedRun a simple three-way dispatch, but deferred the broader cleanup to avoid changing existing behavior.

      Scope:

      • Restructure the modes around an internal AnalyzeModeHandler interface with three implementations, including one registered command, as suggested by calonso. 
      • Unify the remaining collection validation (capped, normal/clustered checks, and stats tracker placement) after agreeing on the correct shared behavior.
      • Replace the histograms path’s internal client flip with the exception safe ScopeGuard pattern already used by NDV.

      Context: review threads on PR #60109

            Assignee:
            Unassigned
            Reporter:
            Aaron Schüttpelz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: