Skip to content

[Python] Trust dataset indexes and expose bounded read caches - #1004

Merged
ColinLeeo merged 5 commits into
apache:developfrom
ColinLeeo:codex/trust-dataset-index
Oct 10, 2026
Merged

ColinLeeo merged 5 commits into
apache:developfrom
ColinLeeo:codex/trust-dataset-index

Conversation

@ColinLeeo

@ColinLeeo ColinLeeo commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Indexed dataset reads currently recheck source file generations and retain prepared-series metadata without a bound. Add trust_index=True by default for immutable datasets and expose per-dataset resource limits through TsFileDataFrame.

  • trust_index=False preserves source generation checks, stale-index rebuilding at open, and errors when files change during queries. Index format and locator bounds remain validated in both modes.
  • Add keyword-only max_prepared_series, descriptor_cache_size, max_open_files, query_workers, and query_parallel_min_rows. Explicit values override environment variables, which override built-in defaults; values are validated before opening resources and fixed for the runtime. Subsets share the same runtime and settings.
  • Bound prepared-series and descriptor caches to 4096 entries by default. Zero disables retention. Prepared-series LRU eviction releases idle native handles while pinning active queries and shared aligned-time owners; active queries may temporarily exceed the retention limit.
  • Pass trust_index directly through the existing internal C APIs. Preserve the optimized Cython index lookup paths.

use_index=False remains the default. trust_index has no effect in that mode, and explicit resource limits require use_index=True.

Validation on the current develop base:

  • C++ library/test binary and Python extensions rebuilt successfully.
  • 283 Python tests passed across dataset read options, dataset indexes, and dataset queries, including trusted/strict reads with cache capacities 0, 1, and 2.
  • 9 native prepared-series/index tests passed.
  • Black, targeted C++ Spotless/clang-format, and git diff --check passed.

@ColinLeeo ColinLeeo changed the title perf(python): trust dataset indexes by default [Python] Trust dataset indexes and expose bounded read caches Oct 10, 2026
@ColinLeeo
ColinLeeo requested a balanced review from Copilot October 10, 2026 07:31

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ColinLeeo
ColinLeeo requested a review from RkGrit October 10, 2026 07:33
Track idle entries in an access-ordered heap and count active leases so wide queries and cache shutdown avoid repeated full-cache scans. Preserve shared time-owner pinning and LRU order, and bound stale heap records.

Add regression coverage for wide queries, out-of-order lease release, shared owner eviction, and repeated cache hits.
@RkGrit
RkGrit requested a balanced review from Copilot October 10, 2026 08:06

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ColinLeeo
ColinLeeo merged commit dfcb047 into apache:develop Oct 10, 2026
43 checks passed
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.

3 participants