Skip to content

Complete configured Volume transfers through the native backend - #613

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

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

Conversation

@aakash-saravanan-db

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

Copy link
Copy Markdown
Collaborator

Feature or gap

Configured staging operations need to finish their Volume transfer through the native backend before executeStatement resolves.

What this PR addresses

Delegate marked file PUT, GET and REMOVE to the shared native core, preserve raw results when staging is omitted, and map staging and local-file errors through the Node API. Native completion declarations and enum exports are generated from the binding source. Closing the session stops a running transfer; the Thrift backend lets it finish. Resolved symlink targets must stay within the allowed roots.

Dependencies

Requires the Volume APIs in databricks/databricks-sql-kernel#513 and a compatible coordinated native release. Platform package pins and locks, plus clean installed-driver validation, must be updated before merge.

Kernel version

The compatible kernel release has not been selected. When it is available, update every platform package pin and lockfile in this PR and validate a clean installation before merge. KERNEL_REV selects source for local and CI builds only.

Tests and validation

The focused suites pass. TypeScript build, production ESLint and formatting pass. Native declarations use NAPI-RS CLI 3.8.2.

@github-actions

Copy link
Copy Markdown

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

@aakash-saravanan-db
aakash-saravanan-db force-pushed the aakash-saravanan_data/feat/volume-restart-20261113 branch from ad49367 to 7b276d7 Compare November 14, 2026 00:40
@github-actions github-actions Bot removed the kernel-e2e Preview-run the SEA Kernel E2E suite on this PR label Nov 14, 2026
@aakash-saravanan-db aakash-saravanan-db added the kernel-e2e Preview-run the SEA Kernel E2E suite on this PR label Nov 14, 2026
@aakash-saravanan-db
aakash-saravanan-db force-pushed the aakash-saravanan_data/feat/volume-restart-20261113 branch from 7b276d7 to 12876fc Compare November 14, 2026 00:52
@aakash-saravanan-db aakash-saravanan-db added kernel-e2e Preview-run the SEA Kernel E2E suite on this PR and removed kernel-e2e Preview-run the SEA Kernel E2E suite on this PR labels Nov 14, 2026
@aakash-saravanan-db
aakash-saravanan-db marked this pull request as ready for review 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 Medium · 1 Low

Mostly sound, with one medium issue: on the kernel path, the new StagingError wrapping can also catch the statement's own execution errors, not just transfer errors. Nits: there is a stray blank line in the CHANGELOG entry, and the constructor comment in KernelOperationBackend still says cancel() "always routes to the cancellable execution". Follow-up (not caused by this PR): executeStatement waits for the transfer before it returns the operation, so a caller can only interrupt an in-flight transfer by closing the session.

Comment thread lib/kernel/KernelOperationBackend.ts 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>
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>
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>

@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 · 2 Low

Needs changes: 1 high, 1 medium. The wiring and error mapping look sound and have tests. But the PR calls a native API that the pinned 1.5.0 bindings don't ship, and nothing checks whether that API is available first.

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 lib/kernel/KernelOperationBackend.ts Resolved
Comment thread CHANGELOG.md Resolved
Comment thread lib/DBSQLSession.ts Resolved
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 High · 2 Low

Mostly sound, with 1 medium and 1 low concern. Delegating to the kernel and mapping its errors looks right, and the unit tests cover the new branches. The native packages are still pinned at 1.5.0, so the new call needs a capability guard, or the pins must land in this PR.

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 lib/DBSQLSession.ts
if (opBackend.completeStagingOperation) {
await this.runBackend(() => opBackend.completeStagingOperation!(allowedLocalPath));
return 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.

🔵 Low — If completeStagingOperation rejects, executeStatement throws after wrapOperation has registered the operation and never closes it. The native statement stays held until session close, which is the same as the existing Thrift staging failure path. Close the operation best-effort on failure and rethrow the original error.

(Anchored to the nearest changed line — see the description for the exact location.)

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

Comment thread CHANGELOG.md
## Unreleased

- Release completed Thrift CloudFetch body-reader listeners so idle connections do not retain downloaded result buffers.
- Support Volume file transfers on the kernel backend when `stagingAllowedLocalPath` is supplied. Symlink targets must remain within configured allowed roots; in-root symlinks are permitted. (#613)

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 — The changelog entry says kernel Volume transfers are supported. It doesn't say they need a published native package newer than 1.5.0 or mention the kernel change they depend on. Add the required version and reference, or bump the pins in this PR.

🔀 Found by Claude Opus 5.5 · confirmed by the judge

const handle = await this.getFetchHandle();
let outcome;
try {
outcome = await handle.completeVolumeOperation(allowedPaths, true); // Thrift REMOVE treats missing objects as success.

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 — The pinned 1.5.0 native binding has no completeVolumeOperation, and assertBindingShape in KernelNativeLoader.ts doesn't check for it. With that binding, any kernel executeStatement that passes stagingAllowedLocalPath, including a plain SELECT, throws a TypeError. Check typeof handle.completeVolumeOperation === 'function' first, or add it to the shape check, and throw a clear error.

🔀 Found by both reviewers · confirmed by the judge

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 High · 1 Low

Mostly sound, with one medium concern: nothing checks that the native binding supports Volume transfers while the platform pins stay at 1.5.0. The PR description acknowledges the pins. Follow-up outside this PR's scope: on both backends, an operation whose staging fails is never closed and stays tracked until the session closes.

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 lib/DBSQLSession.ts
? options.stagingAllowedLocalPath
: [options.stagingAllowedLocalPath];
if (opBackend.completeStagingOperation) {
await this.runBackend(() => opBackend.completeStagingOperation!(allowedLocalPath));

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 — If native completion rejects, executeStatement throws after wrapOperation has already added the operation to the session's collection. The caller never gets the handle, so the operation and native results stay open until session close. The Thrift staging path behaves the same way, so the impact is small. Fix: on failure, best-effort close the operation and remove it from the collection, without masking the original error.

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

const handle = await this.getFetchHandle();
let outcome;
try {
outcome = await handle.completeVolumeOperation(allowedPaths, true); // Thrift REMOVE treats missing objects as success.

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 — The call is made with no check that the binding exposes it, and package.json still pins every kernel platform package at 1.5.0. A binding without the method throws a TypeError for any kernel executeStatement that sets stagingAllowedLocalPath, including plain SELECTs that used to warn and run. Fix: add a typeof guard that falls back to the old behaviour or throws a clear StagingError, and bump the platform pins in the same PR.

🔀 Found by both reviewers · confirmed by the judge

This branch was successfully deployed

1 active deployment
azure-prod — b9da4039 Deployed Nov 30, 2026 by aakash-saravanan-db via e2e-test (26.12.1, 26_12_1) #2246
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