prometheus/promql
Filip Petkovski 1f69dcfa6b
Fix reusing float histograms
In https://github.com/prometheus/prometheus/pull/13276 we started reusing float histogram objects to reduce allocations in PromQL.
That PR introduces a bug where histogram pointers gets copied to the beginning of the histograms slice,
but are still kept in the end of the slice. When a new histogram is read into the last element,
it can overwrite a previous element because the pointer is the same.

This commit fixes the issue by moving outdated points to the end of the slice
so that we don't end up with duplicate pointers in the same buffer. In other words,
the slice gets rotated so that old objects can get reused.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
2023-12-14 11:53:58 +01:00
..
fuzz-data
parser Merge pull request #13059 from zenador/add-mad-function 2023-12-08 11:53:22 +00:00
testdata Make mad_over_time experimental and move tests 2023-12-01 01:56:07 +08:00
bench_test.go Add benchmark for native histograms (#13160) 2023-11-23 14:09:17 +00:00
engine.go Fix reusing float histograms 2023-12-14 11:53:58 +01:00
engine_test.go Fix reusing float histograms 2023-12-14 11:53:58 +01:00
functions.go Add mad_over_time function 2023-12-01 01:22:58 +08:00
functions_test.go golangci-lint: enable testifylint linter (#13254) 2023-12-07 11:35:01 +00:00
fuzz.go textparse/scrape: Add option to scrape both classic and native histograms 2023-05-13 01:32:25 +02:00
fuzz_test.go error for invalid media type should not be completely swallowed (#10186) 2022-02-08 10:57:56 +01:00
promql_test.go sort_by_label: Switch to feature flag 2023-11-28 15:10:12 +01:00
quantile.go PromQL: ignore small errors for bucketQuantile (#13153) 2023-11-25 00:05:38 +01:00
quantile_test.go PromQL: ignore small errors for bucketQuantile (#13153) 2023-11-25 00:05:38 +01:00
query_logger.go add Close for ActiveQueryTracker to close the file. 2023-04-14 14:43:23 +08:00
query_logger_test.go golangci-lint: enable testifylint linter (#13254) 2023-12-07 11:35:01 +00:00
test.go sort_by_label: Switch to feature flag 2023-11-28 15:10:12 +01:00
test_test.go Add context argument to Querier.Select (#12660) 2023-09-12 12:37:38 +02:00
value.go PR feedback 2023-10-18 11:53:50 +02:00
value_test.go Shortcut ContainsSameLabelset() (#11000) 2022-07-13 15:18:10 +05:30