mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
lib/encoding: log the compressed block contents if it cannot be decompressed or unmarshaled
This should help detecting the root cause of https://github.com/VictoriaMetrics/VictoriaMetrics/issues/281
This commit is contained in:
parent
5bb39e757b
commit
4ba4abe666
1 changed files with 4 additions and 4 deletions
|
@ -166,24 +166,24 @@ func unmarshalInt64Array(dst []int64, src []byte, mt MarshalType, firstValue int
|
||||||
bb := bbPool.Get()
|
bb := bbPool.Get()
|
||||||
bb.B, err = DecompressZSTD(bb.B[:0], src)
|
bb.B, err = DecompressZSTD(bb.B[:0], src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot decompress zstd data of size %d: %s", len(src), err)
|
return nil, fmt.Errorf("cannot decompress zstd data of size %d: %s; src_zstd=%X", len(src), err, src)
|
||||||
}
|
}
|
||||||
dst, err = unmarshalInt64NearestDelta(dst, bb.B, firstValue, itemsCount)
|
dst, err = unmarshalInt64NearestDelta(dst, bb.B, firstValue, itemsCount)
|
||||||
bbPool.Put(bb)
|
bbPool.Put(bb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot unmarshal nearest delta data after zstd decompression: %s", err)
|
return nil, fmt.Errorf("cannot unmarshal nearest delta data after zstd decompression: %s; src_zstd=%X", err, src)
|
||||||
}
|
}
|
||||||
return dst, nil
|
return dst, nil
|
||||||
case MarshalTypeZSTDNearestDelta2:
|
case MarshalTypeZSTDNearestDelta2:
|
||||||
bb := bbPool.Get()
|
bb := bbPool.Get()
|
||||||
bb.B, err = DecompressZSTD(bb.B[:0], src)
|
bb.B, err = DecompressZSTD(bb.B[:0], src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot decompress zstd data of size %d: %s", len(src), err)
|
return nil, fmt.Errorf("cannot decompress zstd data of size %d: %s; src_zstd=%X", len(src), err, src)
|
||||||
}
|
}
|
||||||
dst, err = unmarshalInt64NearestDelta2(dst, bb.B, firstValue, itemsCount)
|
dst, err = unmarshalInt64NearestDelta2(dst, bb.B, firstValue, itemsCount)
|
||||||
bbPool.Put(bb)
|
bbPool.Put(bb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot unmarshal nearest delta2 data after zstd decompression: %s", err)
|
return nil, fmt.Errorf("cannot unmarshal nearest delta2 data after zstd decompression: %s; src_zstd=%X", err, src)
|
||||||
}
|
}
|
||||||
return dst, nil
|
return dst, nil
|
||||||
case MarshalTypeNearestDelta:
|
case MarshalTypeNearestDelta:
|
||||||
|
|
Loading…
Reference in a new issue