Repository navigation
Complete Volume file transfers in the Rust kernel core - #512
aakash-saravanan-db wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
🔀 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.
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>
06a005a to
0aca707
Compare
There was a problem hiding this comment.
🔀 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_timeoutdefaults toNone, 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,
| while body.len() < 4096 { | ||
| match storage_read(self.storage.read_timeout, !upload, async { | ||
| response.chunk().await.map_err(response_body_error) | ||
| }) |
There was a problem hiding this comment.
🔵 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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…fault Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Description
SQL
PUT,GETandREMOVEcurrently return an instruction row without moving the file. AddResultStream::complete_volume_operationto 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 = Nonedisables 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.
tempfilemoves 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.