Browse Source
fix_read_tomb_needle_meta (#4263)
Co-authored-by: zemul <zhouzemiao@ihuman.com>
pull/4267/head
zemul
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
1 deletions
-
weed/storage/needle/needle_read_page.go
|
|
@ -66,8 +66,12 @@ func (n *Needle) ReadNeedleMeta(r backend.BackendStorageFile, offset int64, size |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
var index int |
|
|
|
index, err = n.readNeedleDataVersion2NonData(metaSlice) |
|
|
|
if size.IsValid() { |
|
|
|
index, err = n.readNeedleDataVersion2NonData(metaSlice) |
|
|
|
} |
|
|
|
|
|
|
|
n.Checksum = CRC(util.BytesToUint32(metaSlice[index : index+NeedleChecksumSize])) |
|
|
|
if version == Version3 { |
|
|
|
n.AppendAtNs = util.BytesToUint64(metaSlice[index+NeedleChecksumSize : index+NeedleChecksumSize+TimestampSize]) |
|
|
|