Files
qdrant/lib/common
Andrey VasnetsovandClaude Opus 4.8 e87c603b00 perf(universal-io): serve known file length from CachedFs snapshot on plain open (#9741)
`CachedFs::cache_file_info` already snapshots every file's size from the
`list_files` result, but that size was only threaded into opens on the
prefetch path (`schedule_prefetch` -> `with_known_len`). Files opened
directly through the fallback `open` — e.g. segments the loader opens
lazily rather than prefetching — forwarded the caller's `OpenExtra`
unchanged, so `known_len` was `None` and the backend later issued a
remote `len`/HEAD to size the file.

Thread the snapshot size into the fallback open too: when a snapshot
exists and lists the path, apply `with_known_len(info.size)`. This lets
`DiskCacheFs::open` go straight to `State::Ready`, eliminating a remote
metadata round-trip per lazily-opened file on blob backends (S3). No-op
when no snapshot was taken or for backends where `with_known_len` is
meaningless.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 11:16:59 +02:00
..