Skip to content

Complete server-marked Volume transfers in the native kernel - #465

Closed
aakash-saravanan-db wants to merge 67 commits into
mainfrom
aakash-saravanan_data/feat/volume-restart-20261113
Closed

aakash-saravanan-db wants to merge 67 commits into
mainfrom
aakash-saravanan_data/feat/volume-restart-20261113

Conversation

@aakash-saravanan-db

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

Copy link
Copy Markdown
Collaborator

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.

@aakash-saravanan-db
aakash-saravanan-db marked this pull request as ready for review November 14, 2026 02:18
@aakash-saravanan-db
aakash-saravanan-db requested a review from a team as a code owner November 14, 2026 02:18

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

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 — transfer runs blocking filesystem calls directly on the async runtime: std::fs::File::open and metadata here, and the canonicalize/read_link/symlink_metadata calls inside allowed_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 in spawn_blocking, or using tokio::fs equivalents.

Comment thread src/session.rs Resolved
Comment thread pyo3/src/result_stream.rs Resolved
Comment thread pyo3/src/errors.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>
…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>
@aakash-saravanan-db

Copy link
Copy Markdown
Collaborator Author

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

@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 · 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).

Comment thread src/kernel_error.rs
pub cause: Option<Box<Error>>,

/// Original local filesystem failure, for host-language OS error mapping.
pub local_error: Option<Box<LocalFileError>>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 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

Comment thread adbc/src/config.rs
self.http.request_timeout = duration_seconds(value, key)?
}
"SocketTimeout" => self.http.request_timeout = duration(value, key, false)?,
"SocketTimeout" => {

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

Comment thread napi/src/statement.rs
/// 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(

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

@aakash-saravanan-db

Copy link
Copy Markdown
Collaborator Author

Split this change into two stacked PRs:

Together they have exactly the same tree as 435169e7. Closing #465 in favor of those PRs; its branch will stay until both replacements merge.

This branch was successfully deployed

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

2 participants