mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
wal decoder: report file & offset in case of CRC mismatch.
Signed-off-by: Piotr Tabor <ptab@google.com>
This commit is contained in:
parent
bcd5b54e7f
commit
498619bdda
@ -109,9 +109,9 @@ func (d *decoder) decodeRecord(rec *walpb.Record) error {
|
|||||||
d.crc.Write(rec.Data)
|
d.crc.Write(rec.Data)
|
||||||
if err := rec.Validate(d.crc.Sum32()); err != nil {
|
if err := rec.Validate(d.crc.Sum32()); err != nil {
|
||||||
if d.isTornEntry(data) {
|
if d.isTornEntry(data) {
|
||||||
return io.ErrUnexpectedEOF
|
return fmt.Errorf("%w: in file '%s' at position: %d", io.ErrUnexpectedEOF, fileBufReader.FileInfo().Name(), d.lastValidOff)
|
||||||
}
|
}
|
||||||
return err
|
return fmt.Errorf("%w: in file '%s' at position: %d", err, fileBufReader.FileInfo().Name(), d.lastValidOff)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// record decoded as valid; point last valid offset to end of record
|
// record decoded as valid; point last valid offset to end of record
|
||||||
|
Loading…
x
Reference in New Issue
Block a user