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.

clean up *SkipListElementReference loaded from Redis

Chris Lu947add39e6b2
diff --git a/weed/filer/redis3/skiplist_element_store.go b/weed/filer/redis3/skiplist_element_store.go
index fa13d35e91..66a5408d67 100644
--- a/weed/filer/redis3/skiplist_element_store.go
+++ b/weed/filer/redis3/skiplist_element_store.go
@@ -48,5 +48,15 @@ func (m *SkipListElementStore) LoadElement(id int64) (*skiplist.SkipListElement,
}
t := &skiplist.SkipListElement{}
err = proto.Unmarshal([]byte(data), t)
+ if err == nil {
+ for i:=0;i<len(t.Next);i++{
+ if t.Next[i].IsNil() {
+ t.Next[i] = nil
+ }
+ }
+ if t.Prev.IsNil() {
+ t.Prev = nil
+ }
+ }
return t, err
}