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.

only cares about error other than EOF

Chris Lua4cef2fbd4b5
diff --git a/go/storage/needle_map.go b/go/storage/needle_map.go
index e616d676f2..4465fab22a 100644
--- a/go/storage/needle_map.go
+++ b/go/storage/needle_map.go
@@ -3,6 +3,7 @@ package storage
import (
"code.google.com/p/weed-fs/go/util"
"fmt"
+ "io"
"os"
)
@@ -60,7 +61,10 @@ func LoadNeedleMap(file *os.File) (*NeedleMap, error) {
count, e = nm.indexFile.Read(bytes)
}
- return nm, nil
+ if e == io.EOF {
+ e = nil
+ }
+ return nm, e
}
func (nm *NeedleMap) Put(key uint64, offset uint32, size uint32) (int, error) {