prometheus/storage
Filip Petkovski 0d049feac7
Fix encoding samples in ChunkSeries (#12185)
The storage.ChunkSeries iterator assumes that a histogram sample can always be
appended to the currently open chunk. This is not the case when there is a counter reset,
or when appending a stale sample to a chunk with non-stale samples. In addition, the open chunk sometimes
needs to be recoded before a sample can be appended.

This commit addresses the issue by implementing a RecodingAppender which can recode incoming
samples in a transparent way. It also detects cases when a sample cannot be appended at all and
returns `false` so that the caller can open a new chunk.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-04-28 16:52:21 -04:00
..
remote Fix according to code review 2023-04-22 02:27:15 +08:00
buffer.go Fixed sampleRingIterator for mixed histograms 2023-04-14 12:45:36 +02:00
buffer_test.go Merge pull request #12264 from rabenhorst/sample-ring-iterator-mixed-histograms-fix 2023-04-20 16:58:18 +02:00
fanout.go style: Replace else if cascades with switch 2023-04-19 17:22:31 +02:00
fanout_test.go lint: Adjust to the lint warnings raised by current versions of golint-ci 2023-04-19 17:10:10 +02:00
generic.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
interface.go lint: Adjust to the lint warnings raised by current versions of golint-ci 2023-04-19 17:10:10 +02:00
lazy.go tsdb: Added ChunkQueryable implementations to db; unified MergeSeriesSets and vertical to single struct. (#7069) 2020-07-31 16:03:02 +01:00
memoized_iterator.go Merge branch 'main' into sparsehistogram 2021-12-15 13:49:33 +01:00
memoized_iterator_test.go lint: Adjust to the lint warnings raised by current versions of golint-ci 2023-04-19 17:10:10 +02:00
merge.go style: Replace else if cascades with switch 2023-04-19 17:22:31 +02:00
merge_test.go storage: Use separate sample types for histogram vs. float 2023-04-13 19:25:24 +02:00
noop.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
secondary.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
series.go Fix encoding samples in ChunkSeries (#12185) 2023-04-28 16:52:21 -04:00
series_test.go Fix encoding samples in ChunkSeries (#12185) 2023-04-28 16:52:21 -04:00