mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-06 03:57:48 +01:00
filer: keep ciphered chunks on the whole-chunk path
A range fetch cannot save bytes for a ciphered chunk: readEncryptedUrl always downloads and decrypts the whole blob before slicing. Sending partial views of ciphered chunks through fetchChunkRange would repeat the full download per buffer, so they keep the shared whole-chunk path where one download serves every buffer. Prefetch stays enabled for them for the same reason.
This commit is contained in:
1 parent
dd75add62f
commit
521a19c567
3 files changed
+27
-10
No files matched your search
@@ -100,9 +100,11 @@ func (rc *ReaderCache) MaybeCache(chunkViews *Interval[*ChunkView], count int) {
|
||||
// abort when slots are filled
|
||||
return
|
||||
}
|
||||
if !chunkView.IsFullChunk() {
|
||||
// the view is clipped to part of the chunk, so the rest is never
|
||||
// read; prefetching it whole would download bytes nobody needs
|
||||
if chunkView.CipherKey == nil && !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
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user