VictoriaMetrics/lib/promutils
Hui Wang bf3d9ba57b
stream aggregation: fix possible duplicated aggregation results (#7118)
When ingesting samples with the same labels(duplicated samples or
samples with the same labels after `by` or `without` options). They
could register different entries for the same labelset in
LabelsCompressor.
For example, both index 99 and 100 can be assigned to label `foo=1` in
two concurrent pushes. Then due to differing label indexes in encoded
keys, the samples will appear as distinct in aggrState, resulting in
duplicated results after decompressing the label indexes.

fbde238cdc/lib/streamaggr/streamaggr.go (L933)

In this pull request, since we need to store `idxToLabel` first to
ensure the idx can be searched after `lc.labelToIdxStore`,
the `lc.idxToLabel` still could contain a duplicated entries
[100]="foo=1". But given the low likelihood of this issue and the size
of idxToLabel, it should be fine.
2024-09-30 14:30:34 +02:00
..
duration.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:23:26 +02:00
duration_test.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:23:26 +02:00
labels.go all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:23:26 +02:00
labels_test.go lib/promutils: properly return error when incorrect Prometheus label names are passed to NewLabelsFromString() 2023-05-12 17:02:06 -07:00
labels_timing_test.go lib/promscrape: optimize service discovery speed 2022-11-29 21:26:23 -08:00
labelscompressor.go stream aggregation: fix possible duplicated aggregation results (#7118) 2024-09-30 14:30:34 +02:00
labelscompressor_test.go stream aggregation: fix possible duplicated aggregation results (#7118) 2024-09-30 14:30:34 +02:00
labelscompressor_timing_test.go lib/streamaggr: huge pile of changes 2024-03-02 03:15:43 +02:00
time.go app/vlinsert: support _time field without timezone information during data ingestion 2024-09-26 12:50:14 +02:00
time_test.go app/vlinsert: support _time field without timezone information during data ingestion 2024-09-26 12:50:14 +02:00