Skip to content

fix(remote): preserve blob snapshot identity across credential refresh - #5216

Merged
Xuanwo merged 1 commit into
mainfrom
xuanwo/blob-refresh-expiry-m2
Nov 25, 2026
Merged

Xuanwo merged 1 commit into
mainfrom
xuanwo/blob-refresh-expiry-m2

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 25, 2026

Copy link
Copy Markdown
Member

What

Fix the refresh path for direct Blob handles opened from a SQL blob_descriptor.

open_blob_file acquired the resolver's immutable snapshot identity, but the PresignedBlobRangeRequester used blob_locations_context_for_source, which only copied the table handle's expected_query_snapshot. For an ordinary table handle that is None, so a provider credential expiry and refresh could establish a different identity at the same numeric version. The refreshed handle could then accept replacement-table bytes.

The refresh context now carries the identity acquired by the first resolver response, matching the whole-read, range-read and fetch_blob_files paths.

Coverage

Adds five focused tests through the normal open_blob_file entrypoint:

  • proactive refresh inside the 30s expiry skew before any object GET;
  • provider credentials expiring earlier than the advertised URL TTL (far-future expires_at, object store returns 403);
  • single-shot re-resolution: a second 403 after refresh fails without a third resolver call;
  • renewal with a different snapshot identity is rejected before accepting bytes;
  • renewal resolver 403 propagates as an auth failure.

Existing direct_blob_file_refreshes_expired_url_once covered only reactive refresh with no advertised expiry.

Signer contract

The SDK treats object-store 401/403 as expiry and refreshes once. If the resolver signs the refreshed URL with still-expired provider credentials, the second object GET fails and the SDK fails closed. Signers should return an expires_at no later than the underlying credential expiry and use renewed credentials on re-resolution.

Validation

  • cargo test -p lancedb --quiet --features remote --lib remote::table::blobs::tests: 70 passed.
  • cargo check -p lancedb --quiet --features remote --tests: run before the final test pass.
  • No Sophon signer or cloud resource changes.

@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 bug Something isn't working Rust Rust related issues labels Nov 25, 2026
Descriptor-opened direct Blob handles lost the resolver identity in their refresh context, so a credential-expiry retry could accept a replacement table at the same version. Reuse the acquired identity and cover proactive URL expiry, provider expiry earlier than advertised TTL, single-shot re-resolution, renewal identity mismatch, and renewal auth rejection. Log proactive/reactive refresh reasons and resolver identity for native acceptance.
@Xuanwo
Xuanwo force-pushed the xuanwo/blob-refresh-expiry-m2 branch from 76fe117 to 98facbe Compare November 25, 2026 20:30

@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 refresh context now keeps the identity acquired when the descriptor was opened, closing the same-version snapshot substitution gap. Renewal rejects mismatched provenance before fetching refreshed object bytes, while preserving the existing retry and proxy fallback behavior.

@lancedb-gatekeeper lancedb-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 25, 2026
@Xuanwo
Xuanwo merged commit 3d558ad into main Nov 25, 2026
46 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/blob-refresh-expiry-m2 branch November 25, 2026 21:04
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

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance. Rust Rust related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants