From 5bb39e757bdb228338c194c281c41c893a55f5df Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 24 Dec 2019 20:41:06 +0200 Subject: [PATCH] lib/encoding: mention src contents in error message returned from unmarshalInt64NearestDelta* This should simplify detecting the root cause of the issue at https://github.com/VictoriaMetrics/VictoriaMetrics/issues/281 --- lib/encoding/nearest_delta.go | 4 ++-- lib/encoding/nearest_delta2.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/encoding/nearest_delta.go b/lib/encoding/nearest_delta.go index 84d47b971..5ff7f9b61 100644 --- a/lib/encoding/nearest_delta.go +++ b/lib/encoding/nearest_delta.go @@ -60,10 +60,10 @@ func unmarshalInt64NearestDelta(dst []int64, src []byte, firstValue int64, items tail, err := UnmarshalVarInt64s(is.A, src) if err != nil { - return nil, fmt.Errorf("cannot unmarshal nearest delta from %d bytes: %s", len(src), err) + return nil, fmt.Errorf("cannot unmarshal nearest delta from %d bytes; src=%X: %s", len(src), src, err) } if len(tail) > 0 { - return nil, fmt.Errorf("unexpected tail left after unmarshaling %d items from %d bytes; tail size=%d, value=%X", itemsCount, len(src), len(tail), tail) + return nil, fmt.Errorf("unexpected tail left after unmarshaling %d items from %d bytes; tail size=%d; src=%X; tail=%X", itemsCount, len(src), len(tail), src, tail) } v := firstValue diff --git a/lib/encoding/nearest_delta2.go b/lib/encoding/nearest_delta2.go index 7d89c0e11..33d355e55 100644 --- a/lib/encoding/nearest_delta2.go +++ b/lib/encoding/nearest_delta2.go @@ -63,10 +63,10 @@ func unmarshalInt64NearestDelta2(dst []int64, src []byte, firstValue int64, item tail, err := UnmarshalVarInt64s(is.A, src) if err != nil { - return nil, fmt.Errorf("cannot unmarshal nearest delta from %d bytes: %s", len(src), err) + return nil, fmt.Errorf("cannot unmarshal nearest delta from %d bytes; src=%X: %s", len(src), src, err) } if len(tail) > 0 { - return nil, fmt.Errorf("unexpected tail left after unmarshaling %d items from %d bytes; tail size=%d, value=%X", itemsCount, len(src), len(tail), tail) + return nil, fmt.Errorf("unexpected tail left after unmarshaling %d items from %d bytes; tail size=%d; src=%X; tail=%X", itemsCount, len(src), len(tail), src, tail) } v := firstValue