Repository navigation
perf: improve presigned Blob V2 reads - #5247
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
✅ 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.
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.
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.
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 existingLANCE_CLIENT_BLOB_REQUEST_CONCURRENCYlimit (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.