Skip to content

perf: improve presigned Blob V2 reads - #5247

Merged
Xuanwo merged 7 commits into
mainfrom
xuanwo/ent4358-reuse-blob-locations
Nov 27, 2026
Merged

Xuanwo merged 7 commits into
mainfrom
xuanwo/ent4358-reuse-blob-locations

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Behavior

Presigned Blob V2 reads retry an idempotent ranged GET once after a recognized disconnect or timeout before the complete response headers arrive. This includes an abrupt TLS EOF while receiving the headers. A retry preserves the physical Range and the still-valid URL. Expiry triggers resolution on the pinned snapshot. Once the complete headers arrive, the existing status and body paths handle the response. Enterprise connections default to a 300-second pool idle timeout and presigned object-store connections default to 30 seconds. The existing override applies to both pools.

Loopback TCP tests exercise FIN and RST on a reused connection, both with zero response bytes and after a partial header. They verify the send count with retries enabled and disabled, the exact replayed Range and the payload digest. A truncated body after complete headers returns an error after one send.

Direct reads over 16 MiB stream bounded physical ranges into their corresponding slices of the final buffer. The per-read fan-out uses Lance's LANCE_IO_THREADS, capped by the connection's existing LANCE_CLIENT_BLOB_REQUEST_CONCURRENCY limit (8 by default). Each request retains its permit through body consumption. The 10 MiB routing threshold continues to apply to the full logical read.

The connection can reuse unexpired presigned locations for verified rows under the same table, column, snapshot and request credentials. Range offsets and sizes come from the resolver. The existing batch request covers the requested rows of a shared Packed or Managed sidecar. Reopening a verified row uses its prior resolution, and the first open of each unseen SQL descriptor still authorizes just that row. The public API and REST response format are unchanged.

@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 Rust Rust related issues performance labels Nov 27, 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.

The bounded retries, parallel range assembly, and verified-row cache preserve the existing snapshot and credential boundaries.

Documentation: Update the pool idle timeout descriptions in Python and Node, including the generated Node API docs: Enterprise requests default to 300 seconds, while presigned object-store requests now default to 30 seconds. The existing override applies to both.

@lancedb-gatekeeper lancedb-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 27, 2026
@github-actions github-actions Bot added the Python Python SDK label Nov 27, 2026
@lancedb-gatekeeper lancedb-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 27, 2026
@Xuanwo
Xuanwo merged commit 129028f into main Nov 27, 2026
61 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/ent4358-reuse-blob-locations branch November 27, 2026 18:29
Xuanwo added a commit that referenced this pull request Nov 27, 2026
Enterprise SDKs use an inclusive 32 MiB default for eligible Blob V2
direct reads. The paired field comparison with the 10 MiB SDK default
measured higher direct-read latency at 10 and 16 MiB. At 32 MiB, the
interval for the latency difference spanned zero. [SDK version used in
the field comparison](#5247)

The earlier mixed-load test measured lower Plan Executor cache pressure
with direct reads enabled at the 10 MiB cutoff. That result covers the
tested size mix. With the 32 MiB cutoff, reads from 10 MiB up to (but
excluding) 32 MiB go through the proxy, so the impact on executor
traffic and cache pressure depends on the workload's size distribution.

The existing internal override still takes precedence. Direct reads keep
the 16 MiB part size. The Node binding test verifies proxy routing one
byte below the default and two contiguous object-store ranges with a
matching SHA-256 at exactly 32 MiB.
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

performance Python Python SDK Rust Rust related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants