Repository navigation
Complete server-marked Volume transfers in the native kernel - #465
aakash-saravanan-db wants to merge 67 commits into
Conversation
There was a problem hiding this comment.
Verdict: 1 High · 1 Medium · 1 Low · 1 Nit
The per-execution state machine, safe GET replacement and cancellation wiring look solid. I found one high-severity problem: storage transfers inherit the workspace client's total 60s request timeout. There are also a few medium/low concerns in the Python binding and the async filesystem handling.
Other findings
- ⚪ Nit —
transferruns blocking filesystem calls directly on the async runtime:std::fs::File::openandmetadatahere, and thecanonicalize/read_link/symlink_metadatacalls insideallowed_path/resolve_existing_parent. On slow or network filesystems (SMB/NFS roots are common for ODBC users), these block a Tokio worker thread. That worker is shared with other sessions' polling and CloudFetch work. Consider wrapping the path resolution and file opening inspawn_blocking, or usingtokio::fsequivalents.
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>
…nostics 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>
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>
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>
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>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
…pped Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
…oots 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>
|
@vuanhphung on the size: agreed. I'm splitting this into two stacked PRs: the core (transfer code, statement wiring and their tests) and the bindings (C ABI, ADBC, NAPI and PyO3). The four fixes from this round are already on this branch, so the split carries them. I'll link both PRs here when they are up. |
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 · 1 Medium · 2 Low
Mostly solid, with 1 medium and 1 low concern, both about the Volume idle timeout being applied inconsistently across bindings and option keys. I did not fully review src/volume.rs because it was cut from the diff.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
Other findings
- 🔵 Low — A GET opens an existing destination write-only without checking that it is a regular file. If the path is a FIFO with no reader, the open blocks a spawn_blocking worker indefinitely, and cancellation only returns without freeing the worker. Reject non-regular existing destinations before opening, as PUT does for sources. (Found by GPT-6.1 Sol · confirmed by the judge)
Review incomplete
This review did not cover the whole change, so it is posted as a comment and does not approve the PR. Review the items below by hand, or split the PR so the bot can cover all of it:
- The PR diff exceeded the 200,000-byte review cap, so 1 production hunk(s) and 7 docs hunk(s) and 1 test hunk(s) and 15 generated/data hunk(s) were not shown to the reviewer (production:
src/volume.rs; docs:CONNECTION_PARAMETERS.md,NEXT_CHANGELOG.md,README.md,adbc/README.md,napi/NEXT_CHANGELOG.md,napi/README.md,pyo3/NEXT_CHANGELOG.md; tests:tests/v0_volume_wiremock.rs; generated:Cargo.lock,adbc/Cargo.lock,napi/Cargo.lock,pyo3/Cargo.lock).
| pub cause: Option<Box<Error>>, | ||
|
|
||
| /// Original local filesystem failure, for host-language OS error mapping. | ||
| pub local_error: Option<Box<LocalFileError>>, |
There was a problem hiding this comment.
🟠 High — Adding a public field to the exhaustive Error struct breaks downstream struct literals and exhaustive destructuring, and the crate is at 1.5.0. The in-code docs now steer callers to the builders, but the change is still semver-visible. Use a minor/major bump or keep the shape stable.
🔀 Found by GPT-6.1 Sol · confirmed by the judge
| self.http.request_timeout = duration_seconds(value, key)? | ||
| } | ||
| "SocketTimeout" => self.http.request_timeout = duration(value, key, false)?, | ||
| "SocketTimeout" => { |
There was a problem hiding this comment.
🔵 Low — Only SocketTimeout also sets storage_read_timeout, while the adbc.databricks.http_request_timeout key sets only request_timeout. The same logical timeout therefore behaves differently by key, and the second key leaves Volume transfers with no idle limit. Make both keys set it, or document the difference.
(Anchored to the nearest changed line — see the description for the exact location.)
🔀 Found by Claude Opus 5.5 · confirmed by the judge
| /// Runs the file transfer for a Volume PUT, GET or REMOVE result. Call before | ||
| /// fetching; the rows stay readable afterwards. | ||
| #[napi] | ||
| pub async fn complete_volume_operation( |
There was a problem hiding this comment.
🟡 Medium — The NAPI socketTimeoutMs option sets only http.request_timeout and never storage_read_timeout. That field defaults to None, so Node Volume transfers have no idle limit and can hang. PyO3 and ADBC do set it. Set storage_read_timeout next to request_timeout and add a test.
🔀 Found by Claude Opus 5.5 · confirmed by the judge
|
Split this change into two stacked PRs:
Together they have exactly the same tree as |
Feature or gap
SQL PUT, GET and REMOVE results require a client-side storage transfer before the operation is complete.
What this PR addresses
Add explicit completion shared by the Rust API, ADBC, NAPI, PyO3 and C ABI. Enforce lexical and resolved local roots, download GET data before copying it into place, reject missing destination directories before downloading, and cache success or failure. Session and detached cancellers interrupt running transfers.
Storage follows reqwest redirects with Referer disabled and refuses HTTPS-to-HTTP redirects. A file PUT redirected with 307/308 is replayed from the opened file, without reopening its path. On such a redirect, the replay buffer uses one full file's worth of memory. Python Thrift reads every PUT file into memory; Node and Go Thrift fail on these redirects. Caller-supplied stream bytes can also be replayed. GET decodes gzip Content-Encoding before writing, matching Python Thrift.
tempfile moves from a dev dependency to a regular dependency: a GET downloads into a temporary file before it is copied into place.
Storage HTTP errors include the S3 request id and host id when those headers are present.
Dependencies
Consumers require coordinated native releases containing these APIs and compatible package metadata before merge. GET copies into an existing destination in place; a copy failure can leave partial bytes, and a copy already started runs to completion. Storage idle limits cover connection setup, GET reads, initial PUT progress and response waits, but redirected resends have no idle limit.
Tests and validation
Formatting, strict all-target Clippy and the root Rust tests pass: 1,360 passed, 64 ignored. Volume tests cover shared-position and short-file reads, file and stream redirect replay, missing-parent preflight, and async-canceller completion and repeat calls. Compatible installed packages and scheduled execution remain separate delivery gates.