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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix: invalid chunk data when failed to read manifests
geekbooodfdacd94af57a
diff --git a/weed/filer/filechunk_manifest.go b/weed/filer/filechunk_manifest.goindex 091bbee5ae..4eb657dfa5 100644--- a/weed/filer/filechunk_manifest.go+++ b/weed/filer/filechunk_manifest.go@@ -3,7 +3,6 @@ package filerimport ("bytes""fmt"- "github.com/chrislusf/seaweedfs/weed/wdclient""io""math""net/url"@@ -11,6 +10,8 @@ import ("sync""time"+ "github.com/chrislusf/seaweedfs/weed/wdclient"+"github.com/golang/protobuf/proto""github.com/chrislusf/seaweedfs/weed/glog"@@ -63,14 +64,14 @@ func ResolveChunkManifest(lookupFileIdFn wdclient.LookupFileIdFunctionType, chunresolvedChunks, err := ResolveOneChunkManifest(lookupFileIdFn, chunk)if err != nil {- return chunks, nil, err+ return dataChunks, nil, err}manifestChunks = append(manifestChunks, chunk)// recursivesubDataChunks, subManifestChunks, subErr := ResolveChunkManifest(lookupFileIdFn, resolvedChunks, startOffset, stopOffset)if subErr != nil {- return chunks, nil, subErr+ return dataChunks, nil, subErr}dataChunks = append(dataChunks, subDataChunks...)manifestChunks = append(manifestChunks, subManifestChunks...)diff --git a/weed/filer/filechunks.go b/weed/filer/filechunks.goindex 208ef8095c..48b344bf80 100644--- a/weed/filer/filechunks.go+++ b/weed/filer/filechunks.go@@ -3,11 +3,12 @@ package filerimport ("bytes""fmt"- "github.com/chrislusf/seaweedfs/weed/wdclient"- "golang.org/x/exp/slices""math""sync"+ "github.com/chrislusf/seaweedfs/weed/wdclient"+ "golang.org/x/exp/slices"+"github.com/chrislusf/seaweedfs/weed/pb/filer_pb""github.com/chrislusf/seaweedfs/weed/util")@@ -248,6 +249,9 @@ func MergeIntoVisibles(visibles []VisibleInterval, chunk *filer_pb.FileChunk) (nfunc NonOverlappingVisibleIntervals(lookupFileIdFn wdclient.LookupFileIdFunctionType, chunks []*filer_pb.FileChunk, startOffset int64, stopOffset int64) (visibles []VisibleInterval, err error) {chunks, _, err = ResolveChunkManifest(lookupFileIdFn, chunks, startOffset, stopOffset)+ if err != nil {+ return+ }visibles2 := readResolvedChunks(chunks)