yiguolei opened a new pull request, #70902:
URL: https://github.com/apache/doris/pull/70902

   ### Background
   
   IVF_ON_DISK loads a Faiss index containing coarse centers and an optional PQ 
codebook, then reads inverted-list codes and ids on demand. Currently the 
reader retains the loaded index, while a separate cache retains the list data.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #70788 (separate ANN error-handling work, not included or 
required)
   PR Type: Enhancement
   
   Problem Summary:
   
   Allow loaded disk IVF indexes and list data to compete with ordinary data 
pages under the global DATA_PAGE budget. The cache owns each loaded index and 
its input source, while segment searches hold temporary handles. This replaces 
the independent list cache and allows centers and codebooks to be reclaimed 
even while their segment reader remains alive.
   
   ### Details
   
   - **Change map:** Production code: 305 additions and 268 deletions for 
object entries, query-scoped ownership, large-buffer estimates, and removal of 
the separate cache. Tests: 365 additions and 293 deletions for pool sharing, 
eviction, lifetimes, accounting, and migration of existing fixtures. No 
generated or documentation files.
   - **Before and after:** Reader-owned disk IVF indexes become evictable 
DATA_PAGE objects. The estimate covers center buffer capacity and PQ codebook 
capacity. List pages retain allocator tracking and use the same DATA_PAGE pool. 
HNSW and in-memory IVF retain reader ownership.
   - **Configs and defaults:** No new settings. The existing 
storage_page_cache_limit (20% by default) and index_page_cache_percentage (10% 
by default) determine DATA_PAGE capacity. ann_index_ivf_list_cache_limit and 
ann_index_ivf_list_cache_stale_sweep_time_sec remain accepted but ignored; 
data_page_cache_stale_sweep_time_sec applies.
   - **Impact on existing users:** SQL and disk formats are unchanged. ANN now 
competes with ordinary data pages and participates in memory-pressure resizing. 
Old dedicated-cache settings no longer reserve capacity. Operators should 
review their shared page-cache budget on upgrade.
   - **Migration:** Use existing page-cache settings; the old settings are 
retained for configuration parsing compatibility. There is no disk-format 
migration.
   - **Behavior change:** DATA_PAGE uses LRU-K admission. Entries may be 
uncached under pressure, and live query handles may temporarily exceed the 
cache budget. Small metadata, allocation overhead and transient search/load 
buffers are outside the estimate.
   
   ### Testing
   
   Passed local clang-format 16 formatting and check scripts, 
build-support/check-build-hygiene.sh, and git diff --check. Added tests cover 
capacity rather than size, PQ codebooks, list/object competition, disabled 
caching, pin-aware accounting, concurrent loads, TopN/range/error/cancellation 
release, and source destruction order across V2/SNII. The lifecycle test uses 
the real loader to install iterator pins because the existing master BE_TEST 
wrapper bypasses loading.
   
   Builds, unit tests, regression tests, and clang-tidy were not run, following 
the developer's explicit preference. Existing 
ann_index_p0/ivf_on_disk_index_test.groovy remains applicable; no runtime or 
performance result is claimed.
   
   ### Notes for Reviewers
   
   Index objects and list pages both use DATA_PAGE, never INDEX_PAGE. Error 
handling preserves the current master branch fallback behavior; this change is 
independent of #70788. The index source outlives its inputs, and accounting 
remains until the last pin is destroyed. No Faiss allocator changes or 
dependency updates are included.
   
   ### Release note
   
   IVF_ON_DISK indexes and list data now share the global data page cache. The 
separate ANN IVF list cache capacity and stale-sweep settings are deprecated 
and ignored.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details)
   - Does this need documentation: Yes; update the ANN and BE cache 
configuration documentation in apache/doris-website to describe the shared 
DATA_PAGE budget and deprecated settings.
   - Pre-submission status: Partially verified: compilation, unit/regression 
tests, runtime memory behavior, and clang-tidy have not been run.
   
   ### AI Disclosure
   
   - Tool: Codex
   - Generated: Code, tests, and this description.
   - Human review: Not stated.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to