mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-24 16:53:14 +08:00
Filer: fix filer range read (#7078)
* fix filer range read Only return true if we're reading the ENTIRE chunk from the beginning. // This prevents bandwidth amplification when range requests happen to align // with chunk boundaries but don't actually want the full chunk. * Update weed/filer/filechunks.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -178,7 +178,10 @@ func (cv *ChunkView) Clone() IntervalValue {
|
||||
}
|
||||
|
||||
func (cv *ChunkView) IsFullChunk() bool {
|
||||
return cv.ViewSize == cv.ChunkSize
|
||||
// IsFullChunk returns true if the view covers the entire chunk from the beginning.
|
||||
// This prevents bandwidth amplification when range requests happen to align
|
||||
// with chunk boundaries but don't actually want the full chunk.
|
||||
return cv.OffsetInChunk == 0 && cv.ViewSize == cv.ChunkSize
|
||||
}
|
||||
|
||||
func ViewFromChunks(ctx context.Context, lookupFileIdFn wdclient.LookupFileIdFunctionType, chunks []*filer_pb.FileChunk, offset int64, size int64) (chunkViews *IntervalList[*ChunkView]) {
|
||||
|
||||
Reference in New Issue
Block a user