Skip to content

fix(index): avoid fragment reuse cache deadlock - #8620

Merged
Xuanwo merged 1 commit into
mainfrom
gatekeeper/fix-8619-1
Aug 18, 2026
Merged

Xuanwo merged 1 commit into
mainfrom
gatekeeper/fix-8619-1

Conversation

@lance-gatefixer

Copy link
Copy Markdown
Contributor

Summary

  • use the fragment-reuse metadata already loaded before entering the cache loader
  • prevent the loader from recursively probing its own single-flight cache key
  • add a zero-capacity Moka cache regression test for the eviction fallback

Root cause

open_frag_reuse_index loaded the matching metadata, then its cache-miss loader called load_index for the same UUID. load_index delegates to load_indices, which probes the same fragment-reuse cache key. Under eviction pressure, the single-flight leader therefore waited on its own in-flight load indefinitely.

Validation

  • cargo test -p lance test_open_frag_reuse_index_with_zero_capacity_cache -- --nocapture
  • cargo test -p lance test_load_indices -- --nocapture
  • cargo fmt --all
  • cargo clippy --all --tests --benches -- -D warnings

Fixes #8619

@github-actions github-actions Bot added the bug Something isn't working label Aug 18, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

The loader now reuses the immutable fragment-reuse metadata selected before entering the single-flight cache, which removes the same-key re-entry while preserving cache identity and load behavior. The zero-capacity regression directly covers the eviction fallback.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Aug 18, 2026
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Xuanwo
Xuanwo merged commit ff4584f into main Aug 18, 2026
39 of 40 checks passed
@Xuanwo
Xuanwo deleted the gatekeeper/fix-8619-1 branch August 18, 2026 17:44
amunra added a commit to rerun-io/lance that referenced this pull request Aug 27, 2026
)

## Summary

- use the fragment-reuse metadata already loaded before entering the
cache loader
- prevent the loader from recursively probing its own single-flight
cache key
- add a zero-capacity Moka cache regression test for the eviction
fallback

## Root cause

`open_frag_reuse_index` loaded the matching metadata, then its
cache-miss loader called `load_index` for the same UUID. `load_index`
delegates to `load_indices`, which probes the same fragment-reuse cache
key. Under eviction pressure, the single-flight leader therefore waited
on its own in-flight load indefinitely.

## Validation

- `cargo test -p lance
test_open_frag_reuse_index_with_zero_capacity_cache -- --nocapture`
- `cargo test -p lance test_load_indices -- --nocapture`
- `cargo fmt --all`
- `cargo clippy --all --tests --benches -- -D warnings`

Fixes lance-format#8619

<!-- lance-gatekeeper-fix:v1 agent=04eb7f91260e98b8eaa60312dbe80b06
generation=1 -->


(cherry picked from commit ff4584f)

Co-authored-by: lance-gatefixer[bot] <312823363+lance-gatefixer[bot]@users.noreply.github.com>
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deadlock: open_frag_reuse_index's cache loader re-enters its own single-flight key via load_index()

1 participant