Skip to content

refactor(engine): extract spill/tempfile.rs (SPL-3 #2325) - #4434

Merged
oferchen merged 1 commit into
masterfrom
refactor/spl-3-tempfile-retry
May 18, 2026
Merged

oferchen merged 1 commit into
masterfrom
refactor/spl-3-tempfile-retry

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Move SpillBackend, ReadWriteSeek, and open_backend out of crates/engine/src/concurrent_delta/spill.rs into a new spill/tempfile.rs submodule.
  • The tempfile-backed storage primitives are self-contained (no back-references to SpillableReorderBuffer or other spill types) and form a narrow, cohesive disk-facing surface that the rest of the spill layer consumes through a pub(super) API.
  • Pure code movement: no logic changes, no public API change. Visibility tightened to pub(super) since these items were previously module-private and only used inside spill.rs.

Why

spill.rs mixes three concerns: reorder-buffer state, codec/IO record framing, and tempfile-backed storage. Splitting the tempfile primitives out gives the rest of the file room to focus on reordering and serialization while keeping the disk plumbing isolated where ENOSPC and temp-dir-vanish handling can evolve independently. This is the SPL-3 step in the spill.rs decomposition tracked at docs/audits/spill-rs-decomposition-plan.md.

The four test sites that previously called tempfile::tempdir() now use ::tempfile::tempdir() to disambiguate from the new local tempfile module - the only side effect of using the name suggested by the decomposition plan.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings
  • cargo nextest run -p engine --all-features -E 'test(spill)'
  • Full CI matrix (fmt+clippy, nextest stable, Windows, macOS, Linux musl)

oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
Move SpillBackend, ReadWriteSeek, and open_backend from spill.rs into a
new spill/tempfile.rs submodule. The tempfile-backed storage primitives
are self-contained (no back-references to SpillableReorderBuffer or
related types) and form a coherent disk-facing surface that the rest of
the spill layer consumes through a narrow internal API.

Pure code movement: no logic changes, no public API change. Visibility
narrowed to pub(super) since these items were previously module-private
and only consumed inside spill.rs. Tests still reach the symbols via the
same call chain through SpillableReorderBuffer.
@oferchen
oferchen force-pushed the refactor/spl-3-tempfile-retry branch from 32f1350 to e810ce8 Compare May 18, 2026 01:12
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
@oferchen
oferchen merged commit 69712f7 into master May 18, 2026
4 of 15 checks passed
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request May 18, 2026
Move SpillBackend, ReadWriteSeek, and open_backend from spill.rs into a
new spill/tempfile.rs submodule. The tempfile-backed storage primitives
are self-contained (no back-references to SpillableReorderBuffer or
related types) and form a coherent disk-facing surface that the rest of
the spill layer consumes through a narrow internal API.

Pure code movement: no logic changes, no public API change. Visibility
narrowed to pub(super) since these items were previously module-private
and only consumed inside spill.rs. Tests still reach the symbols via the
same call chain through SpillableReorderBuffer.
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request May 18, 2026
Move SpillBackend, ReadWriteSeek, and open_backend from spill.rs into a
new spill/tempfile.rs submodule. The tempfile-backed storage primitives
are self-contained (no back-references to SpillableReorderBuffer or
related types) and form a coherent disk-facing surface that the rest of
the spill layer consumes through a narrow internal API.

Pure code movement: no logic changes, no public API change. Visibility
narrowed to pub(super) since these items were previously module-private
and only consumed inside spill.rs. Tests still reach the symbols via the
same call chain through SpillableReorderBuffer.
@oferchen
oferchen deleted the refactor/spl-3-tempfile-retry branch May 19, 2026 15:12
oferchen added a commit that referenced this pull request Aug 24, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request Aug 24, 2026
Move SpillBackend, ReadWriteSeek, and open_backend from spill.rs into a
new spill/tempfile.rs submodule. The tempfile-backed storage primitives
are self-contained (no back-references to SpillableReorderBuffer or
related types) and form a coherent disk-facing surface that the rest of
the spill layer consumes through a narrow internal API.

Pure code movement: no logic changes, no public API change. Visibility
narrowed to pub(super) since these items were previously module-private
and only consumed inside spill.rs. Tests still reach the symbols via the
same call chain through SpillableReorderBuffer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant