mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
deleted needle does not need checksum verification
This commit is contained in:
parent
185a916f5e
commit
78678f4bcb
|
@ -158,6 +158,9 @@ func (n *Needle) ReadData(r *os.File, offset int64, size uint32, version Version
|
||||||
case Version2:
|
case Version2:
|
||||||
n.readNeedleDataVersion2(bytes[NeedleHeaderSize : NeedleHeaderSize+int(n.Size)])
|
n.readNeedleDataVersion2(bytes[NeedleHeaderSize : NeedleHeaderSize+int(n.Size)])
|
||||||
}
|
}
|
||||||
|
if size == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
checksum := util.BytesToUint32(bytes[NeedleHeaderSize+size : NeedleHeaderSize+size+NeedleChecksumSize])
|
checksum := util.BytesToUint32(bytes[NeedleHeaderSize+size : NeedleHeaderSize+size+NeedleChecksumSize])
|
||||||
newChecksum := NewCRC(n.Data)
|
newChecksum := NewCRC(n.Data)
|
||||||
if checksum != newChecksum.Value() {
|
if checksum != newChecksum.Value() {
|
||||||
|
|
Loading…
Reference in a new issue