Skip to content

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

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

aakash-saravanan-db wants to merge 1 commit 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. File PUT sources must be regular files that report their size. GET downloads into a temporary file before copying into the destination, and rejects a missing destination directory before downloading. Storage errors retain their status and include S3 request and host IDs when available.

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

Testing

Standalone core: 1,137 unit tests and 11 Volume wiremock tests pass. Strict all-target Clippy and formatting pass. All four Cargo manifests resolve with --locked, including the intermediate ADBC and NAPI lockfiles.

The tests cover file and stream transfers, redirect replay, allowed roots, missing destinations, cancellation after parent drop, cached outcomes and unsupported file sources.

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 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.

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 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
Operation::Get(path) => {
let local_file = path.to_string_lossy().into_owned();
let path = allowed_path(&local_file, &roots)?;
let existing = match std::fs::OpenOptions::new().write(true).open(&path) {

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 — GET opens an existing destination for writing inside spawn_blocking. If the destination is a FIFO with no reader, the worker thread blocks forever even after cancellation, and it can stall runtime shutdown. Check that an existing destination is a regular file before opening it, or open it with O_NONBLOCK.

🔀 Found by GPT-6.1 Sol · confirmed by the judge

Comment thread src/types/sea.rs
#[derive(Debug, Clone, Deserialize)]
pub struct ResultManifest {
#[serde(default)]
pub is_volume_operation: bool,

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 — Volume detection depends on the SEA manifest field is_volume_operation and on the instruction column names (operation, presignedUrl, headers, localFile) and their types. Only wiremock fixtures cover these, so nothing confirms they match what a real warehouse sends. Fix: add an ignored tests/v0_volume_e2e.rs that runs PUT, GET and REMOVE against a real Volume.

🔀 Found by Claude Opus 5.5 · the judge couldn't confirm it

Comment thread src/client/http.rs
{
attempt.error("Volume storage redirect cannot downgrade HTTPS to HTTP")
} else {
reqwest::redirect::Policy::default().redirect(attempt)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium — The storage client uses reqwest's default redirect policy. A 303 response turns a PUT or DELETE into a bodiless GET, so a 200 from that GET is reported as Completed without the upload or delete having happened. (reqwest keeps the method on 301/302 for PUT and DELETE.) Reject or handle 303 for mutating requests, and add redirect tests for PUT and DELETE.

🔀 Found by both reviewers · confirmed by the judge

This branch was successfully deployed

1 active deployment
azure-prod — 06a005a6 Deployed Nov 30, 2026 by oss-reviewer-bot[bot] via followup #4429
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