Repository navigation
Description
Decision boundary
The broad storage-v2 design in #26435 is evidence-gated. The latest-main implementation still uses fixed fanout and bucket files, but subsequent ownership, allocation-accounting, recovery, classification, and write-coalescing changes make the original benchmark insufficient as a current implementation trigger.
This issue measures the remaining physical file/FD cost. It does not authorize a storage redesign.
Baseline
- Audit baseline:
main@052b2fdcebce6d8d093624773c03ef3f92afeaef. - Preserve the current hard memory, disk, FD, depth, ownership, and cancellation contracts.
- Use the current implementation as the baseline; do not compare against the pre-accounting numbers from [Design]: spill storage v2 with segment indexes, bounded active FDs, and adaptive fanout #26435 without rerunning them.
Measurement matrix
Measure both:
- The representative initial-spill plus re-spill workload from [Design]: spill storage v2 with segment indexes, bounded active FDs, and adaptive fanout #26435, updated to run on current main.
- At least one normal workload that reaches physical join spill and completes or returns a controlled resource error.
Use one warm-up followed by at least five measured runs under a fixed dataset, DOP, memory limit, spill threshold, FD limit, and storage backend. Report the raw runs as well as the median.
Collect, per query/operator where applicable:
- spill files/segments created;
- peak live spill FDs, effective FD cap, and FD admission failures;
- initial-spill and re-spill depth/fanout;
- classify/materialize, create/open, close, read, and write wall time;
- bytes read/written, allocations, allocated bytes, and end-to-end latency;
- terminal reason and post-query memory/disk/FD accounting.
Prefer benchmark instrumentation or fixed-cardinality operator stats. Do not add per-batch, per-bucket, or per-file logging; do not use query IDs, SQL text, table names, keys, or file names as metric labels.
Deterministic go/no-go rule
Create a separate minimal segment + offset-index implementation issue only when at least one current-main workload demonstrates one of the following:
- an FD admission failure while memory and disk admission still have headroom;
- peak live spill FDs at or above 75% of the effective spill FD cap in at least three of five measured runs;
- median create/open/close plus scatter materialization time is at least 10% of total spill wall time and contributes at least 100 ms to end-to-end latency.
If none of these conditions is met, close this investigation with the measurements and keep storage v2 unimplemented.
Non-goals
- adaptive fanout;
- durable or mixed-version spill-file compatibility;
- checksums or a new frame format;
- a process-wide FD broker;
- planner, threshold-semantics, typed-key, or recovery-memory fixes.
Those require their own reachable reproducer and rollback unit.
Acceptance criteria
- Reproduction commands, exact commit, configuration, and raw measurements are attached.
- Accounting returns to baseline after success, controlled failure, and cancellation.
- The go/no-go result follows the thresholds above rather than qualitative judgment.
- If the gate is met, the follow-up implementation issue is limited to segment + offset index while retaining fixed fanout and the current temporary-file lifetime.
Activity