filer: keep compressed chunks on the whole-chunk path

Like ciphered chunks, a range request on a compressed chunk makes the
volume server read and decompress the whole needle, so range-per-buffer
would repeat the full backend read for each 256KiB window. Route them
through the shared whole-chunk path via ChunkView.CanRangeFetch.
This commit is contained in:
Chris Lu committed 2026-10-03 12:34:55 +08:00
1 parent 521a19c567
commit 1f15e7865a
4 files changed
+34 -15

No files matched your search

+3 -3
View File
@@ -100,11 +100,11 @@ func (rc *ReaderCache) MaybeCache(chunkViews *Interval[*ChunkView], count int) {
// abort when slots are filled
return
}
if chunkView.CipherKey == nil && !chunkView.IsFullChunk() {
if chunkView.CanRangeFetch() && !chunkView.IsFullChunk() {
// the view is clipped to part of the chunk and will be
// range-fetched, so prefetching it whole would download bytes
// nobody needs; a ciphered partial view needs the whole blob
// anyway and is worth prefetching
// nobody needs; a ciphered or compressed partial view needs
// the whole blob anyway and is worth prefetching
continue
}