Skip to content

feat(remote): add presigned direct Blob V2 reads - #5210

Merged
Xuanwo merged 3 commits into
mainfrom
xuanwo/blob-direct-read-sdk
Nov 25, 2026
Merged

Xuanwo merged 3 commits into
mainfrom
xuanwo/blob-direct-read-sdk

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What

Add a capability-gated client path for large Blob V2 reads over LanceDB Enterprise:

  • A successful describe advertises x-lancedb-blob-locations: 1; the SDK then resolves pinned row locations through POST /v1/table/{id}/blob_locations/.
  • Whole reads (fetch_blobs) and seekable handles (fetch_blob_files / open_blob_file) read presigned object-store URLs directly for eligible values and ranges at or above a provisional internal 10 MiB threshold.
  • Small ranges and fetch_blob_ranges stay on the existing proxy path, including aggregate batches whose total exceeds the proxy byte limit.
  • Shared Packed / Managed sidecars translate logical ranges to physical offsets and validate the full numeric Content-Range tuple, not just its start or total.
  • Presigned traffic uses a separate HTTP client with no Enterprise default headers, so service credentials never reach object storage.
  • The first resolver response must carry a valid query-snapshot identity. That identity is then required on every later partition and preserved through object-URL refresh, proxy fallback and oversized whole-value recovery. A resolver 503 falls back once to the proxy path using any version and identity already pinned; other resolver errors propagate. Object-store 503s do not masquerade as resolver unavailability.
  • A read that starts without the capability reuses its supplied ReadSnapshot if a later describe enables direct opening mid-operation.
  • Version and query-snapshot pinning, NULL/order alignment and empty values are preserved.

Client network requirement

On Enterprise clusters that enable direct Blob reads, large values and individual ranges may be fetched from short-lived object-store URLs instead of the LanceDB proxy. Clients then need network access to the object-store endpoint, including private endpoint routing, DNS, TLS trust and egress rules, in addition to the LanceDB endpoint. Small reads stay on the LanceDB proxy.

Why

Large Blob V2 reads currently stream every payload byte through Object Store -> Plan Executor -> Query Node -> client. That consumes internal bandwidth, inflates PE/QN memory use and pollutes executor caches with low-locality .blob data. This is the SDK half of ENT-4358; the server implementation is in Sophon.

Compatibility

No public SDK signatures change. Old clusters omit the capability header and keep the existing proxy behaviour with zero extra round trips. The 10 MiB threshold is an internal prototype choice pending the paired acceptance measurement; it is not a public knob.

Validation

  • cargo check -p lancedb --quiet --features remote --tests passes.
  • cargo test -p lancedb --quiet --features remote --lib remote::table::blobs::tests passes: 65 tests.
  • New coverage includes direct whole reads, shared-sidecar physical offsets and Content-Range rejection, small-range proxy routing, mixed large/small range batches, resolver 503 fallback with pinned state, no second resolver after fallback, object-store 503 not triggering proxy fallback, missing/mismatched resolver identity rejection, resolver identity preservation through refresh/proxy/oversized recovery, supplied-snapshot reuse on mid-operation capability refresh, and NULL/order/null-preserving paths.

A real-QN acceptance run with the candidate SDK binary is separate and still pending deployment of the candidate server image.

Resolve large Blob V2 values through the capability-gated /blob_locations route and read presigned URLs directly. Keep small ranges, inline values, old clusters, and resolver 503 fallbacks on the existing proxy path. Preserve pinned versions and query snapshot identity, translate physical offsets for shared Packed/Managed sidecars, validate Content-Range, and keep object-store traffic free of service credentials.

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@github-actions github-actions Bot added enhancement New feature or request Rust Rust related issues labels Nov 25, 2026
lancedb-gatekeeper[bot]

This comment was marked as outdated.

@lancedb-gatekeeper lancedb-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Nov 25, 2026
Use enumerate for the proxy scatter loop and allow the internal schema fetch helper to carry both Blob capability flags.
@lancedb-gatekeeper lancedb-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Nov 25, 2026
lancedb-gatekeeper[bot]

This comment was marked as outdated.

@lancedb-gatekeeper lancedb-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Nov 25, 2026
Require a valid snapshot identity from the first blob_locations response and preserve it through refresh, proxy fallback, and oversized whole-value recovery. Reuse the caller's ReadSnapshot when capability refresh starts direct handle opening, and document the object-store network access Enterprise direct reads require.
@github-actions github-actions Bot added the Python Python SDK label Nov 25, 2026
@lancedb-gatekeeper lancedb-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Nov 25, 2026

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

⚠️ Gate recommendation: approve with a non-blocking risk.

All three snapshot-consistency findings are fixed. Resolution and proxy recovery now preserve the original pinned state, missing provenance is rejected, and the client network requirements are documented.

Enabling direct reads still carries an integration risk: the candidate SDK/server combination lacks a verified real-QN acceptance run, and the 10 MiB cutoff remains provisional. Deployments can retain proxy behavior by omitting the capability until that validation is available.

@lancedb-gatekeeper lancedb-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. and removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Nov 25, 2026
@Xuanwo
Xuanwo merged commit 60519d4 into main Nov 25, 2026
52 of 56 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/blob-direct-read-sdk branch November 25, 2026 19:16
Xuanwo added a commit that referenced this pull request Nov 30, 2026
Backport presigned Blob V2 reads for Python and TypeScript, including
signed URL reuse, retries, parallel ranged GETs, and the inclusive 32
MiB threshold. Direct reads require the server to advertise support. The
backport includes the snapshot identity check on credential refresh that
the transport changes build on.

Refs #5210, #5216, #5238, #5247, #5248.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. Python Python SDK Rust Rust related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants