Skip to content

Complete Volume file transfers in the Rust kernel core - #512

Open
aakash-saravanan-db wants to merge 7 commits into
mainfrom
aakash-saravanan_data/feat/volume-core-20261130
Open

aakash-saravanan-db wants to merge 7 commits into
mainfrom
aakash-saravanan_data/feat/volume-core-20261130

Conversation

@aakash-saravanan-db

@aakash-saravanan-db aakash-saravanan-db commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Description

SQL PUT, GET and REMOVE currently return an instruction row without moving the file. Add ResultStream::complete_volume_operation to run the storage transfer before reading rows, cache success or failure, and support cancellation through the session or statement.

Local paths and their resolved symlink targets must stay within the caller's allowed directories. The initial check collapses ..; filesystem resolution follows symlinks before applying .., and a missing intervening directory reports the operating system's not-found error. File PUT sources must be regular files that report their size. GET downloads into a temporary file before copying into the destination, and rejects missing or unwritable destination directories before downloading a new file. Storage errors retain their status and include S3 request and host IDs when available.

Volume transfers default to a 15-minute idle limit; HttpConfig::storage_read_timeout = None disables it. A GET follows a 303 redirect; PUT and REMOVE reject it.

Split from #465. Binding adapters follow in bindings PR #513.

Testing

Standalone core: 1,144 unit tests and 10 Volume wiremock tests pass locally. Strict all-target Clippy and formatting pass. Tests cover filesystem traversal through symlinks and .., missing parents, unwritable destinations, GET-only 303 following, maximum-duration idle limits, transfer cancellation and cached outcomes.

Additional notes

This core change has no upstream PR dependency. The bindings follow-up supplies the C ABI, ADBC, NAPI and PyO3 APIs.

tempfile moves from a dev dependency to a regular dependency for GET downloads. A failure during the final copy can leave the destination partly written; a copy that has started finishes despite cancellation. The allowed directories must not have files or links swapped during a transfer.

A file PUT redirected with 301, 302, 307 or 308 is resent from memory, using a buffer equal to the file size. This resend has no idle limit. Python Thrift reads every PUT file into memory; Node and Go Thrift fail on these redirects.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 Medium · 2 Low

Solid, well-tested change with one medium concern. Storage redirects using 301/302/303 can silently turn a PUT or REMOVE into a GET, so the operation reports success without transferring or deleting anything. Also, no live-warehouse test confirms the instruction format.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Comment thread src/volume.rs Resolved
Comment thread src/types/sea.rs Resolved
Comment thread src/client/http.rs Resolved
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
A transfer that succeeds first time no longer logs its duration. Keep both telemetry failure cases and assert the expected timeout text for each idle-test case.

Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 2 Low

Mostly solid, with 2 concerns: a stalled storage transfer has no time limit by default, and a GET into an unwritable directory downloads the whole file before failing. Cancellation, cached outcomes, allowed-root checks and buffered batches all look carefully handled and well tested.

This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge and GPT-6.1 Sol added findings it doesn't mention — see the findings below.

🔀 1 finding considered and dismissed by the judge
  • 🟡 Medium src/config.rs:845 — storage_read_timeout defaults to None, and the storage client is built with no total timeout. With default settings, a storage peer that stalls holds a GET,
    Judge's evidence: storage_read_timeout: None,

Comment thread src/volume.rs
while body.len() < 4096 {
match storage_read(self.storage.read_timeout, !upload, async {
response.chunk().await.map_err(response_body_error)
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — When the GET destination does not exist and its directory is not writable, the code falls back to a system temp file. It downloads the whole object, then create_new fails with PermissionDenied. Fall back to tempfile() only when existing.is_some(), otherwise fail before downloading.

🔀 Found by Claude Opus 5.5 · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept. In this case the GET fails with the OS permission error and leaves nothing behind; the only cost is that the download runs first. Python Thrift has the same order: it reads the whole response and then opens the file. The fallback to the system temp directory is needed when the destination already exists and is writable but its directory is not.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 0aca707: src/volume.rs:429-431 falls back to tempfile() without checking existing, so a new destination in an unwritable directory still downloads the whole object before failing.

Comment thread src/volume.rs Resolved
Comment thread src/volume.rs Resolved
…fault

Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

This branch was previously deployed

1 inactive (outdated) deployment
azure-prod — 0aca707c Deployed Nov 30, 2026 by oss-reviewer-bot[bot] via followup #4482
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant