Skip to content

Commit a791c54

Browse files
authored
MQE: Also apply workaround for shared span slices to range vectors (#9192)
* MQE: Also apply workaround for shared span slices to range vectors This can be removed once prometheus/prometheus#14771 is done. * Update CHANGELOG
1 parent c328187 commit a791c54

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* [CHANGE] Querier: allow wrapping errors with context errors only when the former actually correspond to `context.Canceled` and `context.DeadlineExceeded`. #9175
3333
* [FEATURE] Alertmanager: Added `-alertmanager.log-parsing-label-matchers` to control logging when parsing label matchers. This flag is intended to be used with `-alertmanager.utf8-strict-mode-enabled` to validate UTF-8 strict mode is working as intended. The default value is `false`. #9173
3434
* [FEATURE] Alertmanager: Added `-alertmanager.utf8-migration-logging-enabled` to enable logging of tenant configurations that are incompatible with UTF-8 strict mode. The default value is `false`. #9174
35-
* [FEATURE] Querier: add experimental streaming PromQL engine, enabled with `-querier.query-engine=mimir`. #8422 #8430 #8454 #8455 #8360 #8490 #8508 #8577 #8660 #8671 #8677 #8747 #8850 #8872 #8838 #8911 #8909 #8923 #8924 #8925 #8932 #8933 #8934 #8962 #8986 #8993 #8995 #9008 #9017 #9018 #9019 #9120 #9121 #9136 #9139 #9140 #9145 #9191 #9194 #9196 #9201 #9212
35+
* [FEATURE] Querier: add experimental streaming PromQL engine, enabled with `-querier.query-engine=mimir`. #8422 #8430 #8454 #8455 #8360 #8490 #8508 #8577 #8660 #8671 #8677 #8747 #8850 #8872 #8838 #8911 #8909 #8923 #8924 #8925 #8932 #8933 #8934 #8962 #8986 #8993 #8995 #9008 #9017 #9018 #9019 #9120 #9121 #9136 #9139 #9140 #9145 #9191 #9192 #9194 #9196 #9201 #9212
3636
* [FEATURE] Experimental Kafka-based ingest storage. #6888 #6894 #6929 #6940 #6951 #6974 #6982 #7029 #7030 #7091 #7142 #7147 #7148 #7153 #7160 #7193 #7349 #7376 #7388 #7391 #7393 #7394 #7402 #7404 #7423 #7424 #7437 #7486 #7503 #7508 #7540 #7621 #7682 #7685 #7694 #7695 #7696 #7697 #7701 #7733 #7734 #7741 #7752 #7838 #7851 #7871 #7877 #7880 #7882 #7887 #7891 #7925 #7955 #7967 #8031 #8063 #8077 #8088 #8135 #8176 #8184 #8194 #8216 #8217 #8222 #8233 #8503 #8542 #8579 #8657 #8686 #8688 #8703 #8706 #8708 #8738 #8750 #8778 #8808 #8809 #8841 #8842 #8845 #8853 #8886 #8988
3737
* What it is:
3838
* When the new ingest storage architecture is enabled, distributors write incoming write requests to a Kafka-compatible backend, and the ingesters asynchronously replay ingested data from Kafka. In this architecture, the write and read path are de-coupled through a Kafka-compatible backend. The write path and Kafka load is a function of the incoming write traffic, the read path load is a function of received queries. Whatever the load on the read path, it doesn't affect the write path.

pkg/streamingpromql/operators/range_vector_selector.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ func (m *RangeVectorSelector) fillBuffer(floats *types.FPointRingBuffer, histogr
127127
}
128128
hPoint, _ := histograms.NextPoint()
129129
hPoint.T, hPoint.H = m.chunkIterator.AtFloatHistogram(hPoint.H)
130+
// The following works around an optimisation that can cause a problem when we re-use native histograms.
131+
// The optimisation uses the same span slices between native histogram points if the spans are the same.
132+
// This is fine when the buffer is filled for a first series. However when the buffer is reset for a new
133+
// series, we retain the histograms in memory and then overwrite them with `AtFloatHistogram`.
134+
// A problem can then occur when `AtFloatHistogram` tries to populate the spans, incorrectly keeping the
135+
// same span between histograms where they should be different.
136+
// This workaround can be reverted once https://github.com/prometheus/prometheus/pull/14771 is vendored.
137+
applyWorkaroundForSharedSpanSlices(hPoint.H)
130138
if value.IsStaleNaN(hPoint.H.Sum) {
131139
// Range vectors ignore stale markers
132140
// https://github.com/prometheus/prometheus/issues/3746#issuecomment-361572859

0 commit comments

Comments
 (0)