Repository navigation
tantivy: key the bundle disk cache by aligned 1 MiB chunks - #435
Conversation
Exact-range keys only hit when a read asked for the same run of blocks that filled the cache, which a restart reproduces but a partly evicted block cache does not: a busy process refetched 828 MB of a 7-day errors list from S3 that the disk tier already held. Reads are now assembled from aligned chunks, each contiguous run of missing chunks fetched in one GET.
Monoscope production impact · Worth checkingProject Evidence window (UTC): 2026-10-18 23:34:36.258669085 UTC → 2026-10-25 23:34:36.258669085 UTC
Production details are available in Monoscope. Coverage: Open Monoscope for evidence and coverage details. |
ReviewOverall: a clean, focused change. The aligned-chunk design fixes the exact-range key misses, and the test is well thought out (fresh range per attempt, so retries can't serve themselves). Notes below, roughly by importance. Read amplification on cold misses. Any miss now fetches at least one whole 1 MiB chunk. That includes the many tiny reads tantivy makes (term dict and postings fragments of a few KB) on a first-ever read of a region. Short-chunk poisoning if Edge cases when Minor
Nothing blocking from a security standpoint: keys are derived from internal paths and there is no user-controlled input. Looks good to merge once the short-chunk check is considered. |
Follow-up to #429. Exact-range disk-cache keys only hit when a read asks for the same run of blocks that filled the cache. A restart reproduces that (verified: 30d first load read 1,022 MB from disk), but a partly evicted block cache asks for different runs: a busy 2-hour-old process refetched 828 MB of a 7-day errors list from S3 that the disk tier already held (10.1 s first load).
StoreSourcenow learns the bundle length when the directory is built and serves reads from aligned 1 MiB chunks: chunk lookups run concurrently, each contiguous run of missing chunks is one GET, fetched chunks are inserted disk-only, and the range is assembled by slice copies.Test:
an_overlapping_range_is_served_from_disk_chunks(a range never read whole is served with zero object-store reads; each attempt uses a new range so retries cannot serve themselves); red with range-dependent keys.Local signoff:
make ci-signofffmt/test/pg-smoke/e2e/clippy all pass (attested).🤖 Generated with Claude Code