Repository navigation
Complete server-marked Volume transfers in the native kernel - #465
aakash-saravanan-db wants to merge 63 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>
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>
…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>
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 · 3 Low
Mostly solid: 1 medium and 2 low concerns, all about the bindings behaving differently. The core completion and caching, the cancellation wiring and the path checks look sound; parts of src/volume.rs were only partly readable because of size caps.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
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).
vuanhphung
left a comment
There was a problem hiding this comment.
This PR is getting a little too big. Can your factory break it down further?
|
|
||
| async fn cancel(&self) -> Result<()> { | ||
| async { | ||
| self.valid.check()?; |
There was a problem hiding this comment.
Since 9ed6b72, dropping the Statement invalidates valid without cancelling completion, so valid.check()? here returns InvalidStatementHandle before cancel_volume() runs and the transfer keeps going. Same at :1252 for AsyncStatementCanceller. Can these do the same, with a test for submit → await_result → drop stmt → complete → cancel?
| .map_err(map_kernel_error)?; | ||
| return Ok(count); | ||
| } | ||
| let executed = self.execute_inner()?; |
There was a problem hiding this comment.
With staging_allowed_local_paths unset, complete_volume returns Ok and execute_update returns only the row count, so ExecuteUpdate("REMOVE '/Volumes/...'") reports success and deletes nothing. Python raises when no staging path is configured. Can execute_update fail with InvalidState naming the option when the result is a Volume op?
| @@ -348,6 +349,7 @@ impl ExecutedStatementHandle for ExecutedStatement { | |||
| } | |||
|
|
|||
| async fn cancel(&self) -> Result<()> { | |||
There was a problem hiding this comment.
Sync Volume results come back inline CLOSED (closed=true at mutable.rs:413), but cancel() still sends CancelStatement, which napi's comment at statement.rs:136-140 says fails with a server error. So cancelling a slow PUT stops it and then reports failure (ADBC Connection::cancel → Status::Unknown). Can we skip the RPC when closed is set?
| .unwrap_or_else(|| std::io::ErrorKind::IsADirectory.into()); | ||
| return Err(local_error(error, &local_file)); | ||
| } | ||
| source = Some((file, metadata.len())); |
There was a problem hiding this comment.
Only directories are rejected, so a FIFO or procfs source sends Content-Length: 0 (or a stale size) and the PUT reports Completed with an empty or truncated object. Can we reject !metadata.is_file() with VOLUME_LOCAL_FILE_ERROR, ideally before open so FIFOs don't block either?
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.