related to https://github.com/seaweedfs/seaweedfs/issues/3882
@ -24,6 +24,7 @@ const (
)
var ErrorSizeMismatch = errors.New("size mismatch")
var ErrorSizeInvalid = errors.New("size invalid")
func (n *Needle) DiskSize(version Version) int64 {
return GetActualSize(n.Size, version)
@ -43,6 +43,9 @@ func (n *Needle) ReadNeedleMeta(r backend.BackendStorageFile, offset int64, size
return ErrorSizeMismatch
}
if !n.Size.IsValid() {
return ErrorSizeInvalid
n.DataSize = util.BytesToUint32(bytes[NeedleHeaderSize : NeedleHeaderSize+DataSizeSize])
startOffset := offset + NeedleHeaderSize + DataSizeSize + int64(n.DataSize)