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.

Merge branch 'mount_from_outside_cluster'

Chris Lu17f7c1c43f8a
diff --cc weed/filesys/filehandle.go
index 5701b92b7a,da42ae5622..168bf792d3
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@@ -126,14 -126,12 +126,14 @@@ func (fh *FileHandle) readFromChunks(bu
fh.f.reader = nil
}
- if fh.f.reader == nil {
+ reader := fh.f.reader
+ if reader == nil {
chunkViews := filer.ViewFromVisibleIntervals(fh.f.entryViewCache, 0, math.MaxInt64)
- reader = filer.NewChunkReaderAtFromClient(fh.f.wfs, chunkViews, fh.f.wfs.chunkCache, fileSize)
- fh.f.reader = filer.NewChunkReaderAtFromClient(fh.f.wfs.LookupFn(), chunkViews, fh.f.wfs.chunkCache, fileSize)
++ reader = filer.NewChunkReaderAtFromClient(fh.f.wfs.LookupFn(), chunkViews, fh.f.wfs.chunkCache, fileSize)
}
+ fh.f.reader = reader
- totalRead, err := fh.f.reader.ReadAt(buff, offset)
+ totalRead, err := reader.ReadAt(buff, offset)
if err != nil && err != io.EOF {
glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err)