Skip to content

[Design]: make join spill thresholds explicitly versioned and unit-safe #26434

Closed as not planned

Description

@XuPeng-SH

Context

Follow-up from #26408 and #26412. #26412 preserves the configured spill threshold across remote operator round-trips, but the threshold's legacy unit contract remains ambiguous.

Problem

The current compatibility rule interprets values <= 100000 as rows and values > 100000 as bytes. This makes the setting non-monotonic at the 100000 -> 100001 boundary and prevents callers, remote executors, configuration tooling, and diagnostics from knowing the unit from the value alone.

Changing the interpretation in place would break existing configurations and mixed-version clusters.

Proposed direction

  • Introduce a versioned threshold representation such as {value, unit, version}.
  • Normalize all internal admission logic to bytes, while retaining an explicit legacy-rows migration path.
  • Preserve the representation across plan serialization, remote execution, retries, prepared statements, and observability output.
  • Define mixed-version negotiation and fail-safe behavior for unknown versions/units.

Acceptance criteria

  • Values 0, 1, 100000, and 100001 have explicit, monotonic, documented behavior.
  • Legacy row-based configurations retain their old meaning through a tested migration layer.
  • New configurations never infer units from numeric magnitude.
  • Local/remote and mixed-version round-trip tests cover HashJoin, DedupJoin, and RightDedupJoin.
  • Logs and metrics report both normalized bytes and the original configured value/unit.
  • Invalid or unsupported units fail with a stable actionable error rather than silently changing policy.

Related: #26408, #26412.

Activity

  1. added
    severity/s0
    on Jul 30, 2026
  2. XuPeng-SH commented on Aug 1, 2026

    @XuPeng-SH
    ContributorAuthor

    Roadmap decision: #26563. Treat this as Phase 2 compatibility work, not a blocker for current correctness fixes. Start with 0/1/100000/100001 boundary tests, local/remote round-trip coverage, documentation of legacy magnitude inference, and original/resolved mode in EXPLAIN/operator stats. Add a minimal explicit unit only when an ambiguous value and a real mixed-version requirement are demonstrated; do not build a general version-negotiation framework preemptively.

  3. XuPeng-SH commented on Aug 12, 2026

    @XuPeng-SH
    ContributorAuthor

    Superseded by the concrete reproduction and root-cause evidence in #26924.

    That issue establishes that the configured value reaches every worker, byte/row inference follows the current compatibility rule, the decision is per worker and pre-HashMap, and the displayed logical Join memory is not the threshold input. The remaining actionable scope is to make the resolved mode/value, build side, per-worker decision input, eligibility, decision, and reason observable before considering any semantic change.

    #26924 is already transferred for testing and is intentionally not modified by this consolidation. Closing this broader version-negotiation design as superseded, not completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/designseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions