Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

fix tests

chrislub541e39a2c18
diff --git a/weed/filer/reader_at.go b/weed/filer/reader_at.go
index 35e0012c86..68594cb03a 100644
--- a/weed/filer/reader_at.go
+++ b/weed/filer/reader_at.go
@@ -175,10 +175,6 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) {
func (c *ChunkReadAt) readChunkSlice(chunkView *ChunkView, nextChunkViews *ChunkView, offset, length uint64) ([]byte, error) {
- if c.readerPattern.IsRandomMode() {
- return c.doFetchRangeChunkData(chunkView, offset, length)
- }
-
var chunkSlice []byte
if chunkView.LogicOffset == 0 {
chunkSlice = c.chunkCache.GetChunkSlice(chunkView.FileId, offset, length)
@@ -189,6 +185,9 @@ func (c *ChunkReadAt) readChunkSlice(chunkView *ChunkView, nextChunkViews *Chunk
if c.lookupFileId == nil {
return nil, nil
}
+ if c.readerPattern.IsRandomMode() {
+ return c.doFetchRangeChunkData(chunkView, offset, length)
+ }
chunkData, err := c.readFromWholeChunkData(chunkView, nextChunkViews)
if err != nil {
return nil, err