Skip to content

[docs](lance) Document FE table access cache - #4159

Merged
Gabriel39 merged 1 commit into
apache:masterfrom
Gabriel39:dev/lance-table-access-cache-docs
Sep 21, 2026
Merged

Gabriel39 merged 1 commit into
apache:masterfrom
Gabriel39:dev/lance-table-access-cache-docs

Conversation

@Gabriel39

Copy link
Copy Markdown
Contributor

Repeated Lance query planning can resolve the same table location on every read. Document the FE access cache introduced by apache/doris#68305, including its TTL property, credential exclusions, refresh behavior, and separation from Dataset versions and BE caches.

This draft depends on the product PR. Merge after the implementation is accepted.

Self-review:

  • Goal: explain when the cache applies and how to disable or invalidate it; both English and Chinese describe the same behavior.
  • Scope: one property row and one focused section in each existing 4.x Lance Catalog page.
  • Information architecture: existing paths, front matter, navigation, and anchors remain unchanged. Lance Catalog currently has no corresponding current-version page; this intentionally updates the existing 4.x pair only.
  • Links: new section links match their headings; the implementation link identifies the required change without claiming an unreleased feature is already available in every 4.x build.
  • Frontend: no component, styling, configuration, or build-script changes.
  • Validation: git diff whitespace check and standalone MDX compilation passed for both pages (front matter and existing Docusaurus explicit heading IDs normalized for the standalone compiler). The i18n sync lint passed with its existing missing-current-counterpart warning. A full Docusaurus build was not run.
  • Other findings: no additional correctness or usability issues found in the changed content.

Gabriel39 added a commit to apache/doris that referenced this pull request Sep 21, 2026
### What problem does this PR solve?

Repeated Lance metadata reads call `describeTable` before opening the
Dataset, even when the catalog already shares a Lance metadata Session.
This repeats filesystem discovery or REST requests and serializes
callers on the namespace lock during query planning.

Cache immutable table URIs and normalized access options for both
filesystem and REST catalogs. Cache hits bypass the namespace lock, and
concurrent misses for the same table share one load. Dataset opens and
snapshot selection still run for every read.

- Add `lance.table_access_cache_ttl_seconds` (default `60`; `0` disables
caching), with at most 10,000 entries per catalog client generation.
Reads do not extend the TTL.
- Resolve responses containing vended storage options on every read,
even when `expires_at_millis` is present: the BE cannot renew
credentials during an arbitrarily long scan. Also bypass caching for
credential-bearing or unclassified URIs, including userinfo, query
parameters, and fragments. Plain filesystem and REST responses without
vended options remain cacheable.
- Explicit table/database refresh, catalog invalidation, and namespace
removal retire the access cache, including in-flight loads. Refresh
replay invalidates before cache-only object lookup, including when local
database/table objects are absent. Routine database-object eviction
preserves access entries. Table/database refresh conservatively clears
all access entries because Doris refresh names may be mapped names; it
does not rotate the native Session.
- Keep index inspection/admission and current index-job locator
validation on an uncached path so they verify the current target.

### Release note

Reduce repeated Lance query-planning work by caching table access
resolution for filesystem and REST catalogs, with credential-safe cache
eligibility and explicit refresh invalidation.

### Validation

- Added regression tests that first failed on the original
implementation: two reads caused two `describeTable` calls for both
filesystem and REST catalogs.
- Added regressions reproduced five failures before the review fixes:
credential reuse, signed URIs, routine database-object eviction, and
refresh replay with missing table/database objects.
- 66 FE tests passed (0 failures/errors/skips): access-cache expiry,
credential handling, concurrent loading/invalidation, catalog lifecycle,
property validation, filesystem/REST catalogs, and metadata-cache
routing.
- FE Checkstyle passed with zero violations.
- No end-to-end latency benchmark was run.

### Check List (For Author)

- Test
  - [x] Unit Test
- Behavior changed:
- [x] Yes. Table URI/access-option changes can remain cached until TTL
expiry or explicit refresh; Dataset versions are not cached here. Set
`lance.table_access_cache_ttl_seconds=0` to retain per-read resolution.
- Does this need documentation?
- [x] Yes. English and Chinese documentation:
apache/doris-website#4159 (draft pending this
implementation). Covers the TTL property, credential exclusions, refresh
behavior, and FE/BE cache separation.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
@Gabriel39
Gabriel39 marked this pull request as ready for review September 21, 2026 08:02
@Gabriel39
Gabriel39 merged commit 96ce54e into apache:master Sep 21, 2026
3 checks passed
yiguolei pushed a commit to apache/doris that referenced this pull request Sep 21, 2026
### What problem does this PR solve?

Repeated Lance metadata reads call `describeTable` before opening the
Dataset, even when the catalog already shares a Lance metadata Session.
This repeats filesystem discovery or REST requests and serializes
callers on the namespace lock during query planning.

Cache immutable table URIs and normalized access options for both
filesystem and REST catalogs. Cache hits bypass the namespace lock, and
concurrent misses for the same table share one load. Dataset opens and
snapshot selection still run for every read.

- Add `lance.table_access_cache_ttl_seconds` (default `60`; `0` disables
caching), with at most 10,000 entries per catalog client generation.
Reads do not extend the TTL.
- Resolve responses containing vended storage options on every read,
even when `expires_at_millis` is present: the BE cannot renew
credentials during an arbitrarily long scan. Also bypass caching for
credential-bearing or unclassified URIs, including userinfo, query
parameters, and fragments. Plain filesystem and REST responses without
vended options remain cacheable.
- Explicit table/database refresh, catalog invalidation, and namespace
removal retire the access cache, including in-flight loads. Refresh
replay invalidates before cache-only object lookup, including when local
database/table objects are absent. Routine database-object eviction
preserves access entries. Table/database refresh conservatively clears
all access entries because Doris refresh names may be mapped names; it
does not rotate the native Session.
- Keep index inspection/admission and current index-job locator
validation on an uncached path so they verify the current target.

### Release note

Reduce repeated Lance query-planning work by caching table access
resolution for filesystem and REST catalogs, with credential-safe cache
eligibility and explicit refresh invalidation.

### Validation

- Added regression tests that first failed on the original
implementation: two reads caused two `describeTable` calls for both
filesystem and REST catalogs.
- Added regressions reproduced five failures before the review fixes:
credential reuse, signed URIs, routine database-object eviction, and
refresh replay with missing table/database objects.
- 66 FE tests passed (0 failures/errors/skips): access-cache expiry,
credential handling, concurrent loading/invalidation, catalog lifecycle,
property validation, filesystem/REST catalogs, and metadata-cache
routing.
- FE Checkstyle passed with zero violations.
- No end-to-end latency benchmark was run.

### Check List (For Author)

- Test
  - [x] Unit Test
- Behavior changed:
- [x] Yes. Table URI/access-option changes can remain cached until TTL
expiry or explicit refresh; Dataset versions are not cached here. Set
`lance.table_access_cache_ttl_seconds=0` to retain per-read resolution.
- Does this need documentation?
- [x] Yes. English and Chinese documentation:
apache/doris-website#4159 (draft pending this
implementation). Covers the TTL property, credential exclusions, refresh
behavior, and FE/BE cache separation.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
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