diff --git a/tsdb/head_test.go b/tsdb/head_test.go index 143bbe9450..46a65e0ef5 100644 --- a/tsdb/head_test.go +++ b/tsdb/head_test.go @@ -4803,7 +4803,7 @@ func TestOOOHistogramCounterResetHeaders(t *testing.T) { numSamples: 1, }, expOOOMmappedChunks{ - header: chunkenc.CounterReset, + header: chunkenc.UnknownCounterReset, mint: 210, maxt: 210, numSamples: 1, diff --git a/tsdb/ooo_head.go b/tsdb/ooo_head.go index 9ccd1d9ac6..5e214a6d9c 100644 --- a/tsdb/ooo_head.go +++ b/tsdb/ooo_head.go @@ -137,7 +137,7 @@ func (o *OOOChunk) ToEncodedChunks(mint, maxt int64) (chks []memChunk, err error if newChunk != nil { // A new chunk was allocated. if !recoded { hc := newChunk.(*chunkenc.HistogramChunk) - if s.h.CounterResetHint != histogram.CounterReset && hc.GetCounterResetHeader() == chunkenc.CounterReset { + if hc.GetCounterResetHeader() == chunkenc.CounterReset { // Clear the detected counter reset in the chunk as we cannot trust // it in OOO. hc.ClearCounterReset() @@ -158,7 +158,7 @@ func (o *OOOChunk) ToEncodedChunks(mint, maxt int64) (chks []memChunk, err error if newChunk != nil { // A new chunk was allocated. if !recoded { hc := newChunk.(*chunkenc.FloatHistogramChunk) - if s.fh.CounterResetHint != histogram.CounterReset && hc.GetCounterResetHeader() == chunkenc.CounterReset { + if hc.GetCounterResetHeader() == chunkenc.CounterReset { // Clear the detected counter reset in the chunk as we cannot trust // it in OOO. hc.ClearCounterReset() diff --git a/tsdb/ooo_head_test.go b/tsdb/ooo_head_test.go index 830d575b14..c5386757a5 100644 --- a/tsdb/ooo_head_test.go +++ b/tsdb/ooo_head_test.go @@ -217,7 +217,7 @@ func TestOOOChunks_ToEncodedChunks(t *testing.T) { {t: 1000, h: h1}, {t: 1100, h: h2explicit}, }, - expectedCounterResets: []histogram.CounterResetHint{histogram.UnknownCounterReset, histogram.CounterReset}, + expectedCounterResets: []histogram.CounterResetHint{histogram.UnknownCounterReset, histogram.UnknownCounterReset}, expectedChunks: []chunkVerify{ {encoding: chunkenc.EncHistogram, minTime: 1000, maxTime: 1000}, {encoding: chunkenc.EncHistogram, minTime: 1100, maxTime: 1100},