mirror of
https://github.com/qdrant/qdrant.git
synced 2026-10-03 03:17:43 -05:00
`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>