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 { |
|
|
if err != nil { |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var index int |
|
|
var index int |
|
|
|
|
|
if size.IsValid() { |
|
|
index, err = n.readNeedleDataVersion2NonData(metaSlice) |
|
|
index, err = n.readNeedleDataVersion2NonData(metaSlice) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
n.Checksum = CRC(util.BytesToUint32(metaSlice[index : index+NeedleChecksumSize])) |
|
|
n.Checksum = CRC(util.BytesToUint32(metaSlice[index : index+NeedleChecksumSize])) |
|
|
if version == Version3 { |
|
|
if version == Version3 { |
|
|
n.AppendAtNs = util.BytesToUint64(metaSlice[index+NeedleChecksumSize : index+NeedleChecksumSize+TimestampSize]) |
|
|
n.AppendAtNs = util.BytesToUint64(metaSlice[index+NeedleChecksumSize : index+NeedleChecksumSize+TimestampSize]) |
|
|