From cfcd51538dede02375a02aaf478e7fc7ac299890 Mon Sep 17 00:00:00 2001 From: Carrie Edwards Date: Mon, 28 Oct 2024 09:49:08 -0700 Subject: [PATCH] Remove references to custom values record --- tsdb/head.go | 2 -- tsdb/head_append.go | 11 ----------- tsdb/head_wal.go | 35 ----------------------------------- tsdb/record/record.go | 10 +--------- 4 files changed, 1 insertion(+), 57 deletions(-) diff --git a/tsdb/head.go b/tsdb/head.go index b7a358a6a6..c67c438e52 100644 --- a/tsdb/head.go +++ b/tsdb/head.go @@ -87,7 +87,6 @@ type Head struct { logger *slog.Logger appendPool zeropool.Pool[[]record.RefSample] exemplarsPool zeropool.Pool[[]exemplarWithSeriesRef] - customValuesPool zeropool.Pool[[]record.RefCustomValues] histogramsPool zeropool.Pool[[]record.RefHistogramSample] floatHistogramsPool zeropool.Pool[[]record.RefFloatHistogramSample] metadataPool zeropool.Pool[[]record.RefMetadata] @@ -2135,7 +2134,6 @@ type memSeries struct { // We keep the last histogram value here (in addition to appending it to the chunk) so we can check for duplicates. lastHistogramValue *histogram.Histogram lastFloatHistogramValue *histogram.FloatHistogram - customValues []float64 // Current appender for the head chunk. Set when a new head chunk is cut. // It is nil only if headChunks is nil. E.g. if there was an appender that created a new series, but rolled back the commit diff --git a/tsdb/head_append.go b/tsdb/head_append.go index 7601f7847b..7dacb9037b 100644 --- a/tsdb/head_append.go +++ b/tsdb/head_append.go @@ -1458,17 +1458,6 @@ func (a *headAppender) Commit() (err error) { a.commitFloatHistograms(acc) a.commitMetadata() - a.head.metrics.outOfOrderSamples.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.floatOOORejected)) - a.head.metrics.outOfOrderSamples.WithLabelValues(sampleMetricTypeHistogram).Add(float64(acc.histoOOORejected)) - a.head.metrics.outOfBoundSamples.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.floatOOBRejected)) - a.head.metrics.tooOldSamples.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.floatTooOldRejected)) - a.head.metrics.samplesAppended.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.floatsAppended)) - a.head.metrics.samplesAppended.WithLabelValues(sampleMetricTypeHistogram).Add(float64(acc.histogramsAppended)) - a.head.metrics.outOfOrderSamplesAppended.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.oooFloatsAccepted)) - a.head.metrics.outOfOrderSamplesAppended.WithLabelValues(sampleMetricTypeHistogram).Add(float64(acc.oooHistogramAccepted)) - a.head.updateMinMaxTime(acc.inOrderMint, acc.inOrderMaxt) - a.head.updateMinOOOMaxOOOTime(acc.oooMinT, acc.oooMaxT) - acc.collectOOORecords(a) if a.head.wbl != nil { if err := a.head.wbl.Log(acc.oooRecords...); err != nil { diff --git a/tsdb/head_wal.go b/tsdb/head_wal.go index 885d14a08b..dd4f4f8b17 100644 --- a/tsdb/head_wal.go +++ b/tsdb/head_wal.go @@ -332,19 +332,6 @@ Outer: if r, ok := multiRef[sam.Ref]; ok { sam.Ref = r } - if histogram.IsCustomBucketsSchema(sam.H.Schema) { - ms := h.series.getByID(sam.Ref) - if ms == nil { - unknownHistogramRefs.Inc() - continue - } - - if ms.lastFloatHistogramValue != nil { - sam.H.CustomValues = ms.lastFloatHistogramValue.CustomValues - } else { - sam.H.CustomValues = ms.customValues - } - } mod := uint64(sam.Ref) % uint64(concurrency) histogramShards[mod] = append(histogramShards[mod], histogramRecord{ref: sam.Ref, t: sam.T, h: sam.H}) } @@ -381,14 +368,6 @@ Outer: if r, ok := multiRef[sam.Ref]; ok { sam.Ref = r } - if histogram.IsCustomBucketsSchema(sam.FH.Schema) { - ms := h.series.getByID(sam.Ref) - if ms == nil { - unknownHistogramRefs.Inc() - continue - } - sam.FH.CustomValues = ms.customValues - } mod := uint64(sam.Ref) % uint64(concurrency) histogramShards[mod] = append(histogramShards[mod], histogramRecord{ref: sam.Ref, t: sam.T, fh: sam.FH}) } @@ -641,22 +620,8 @@ func (wp *walSubsetProcessor) processWALSamples(h *Head, mmappedChunks, oooMmapp var chunkCreated bool if s.h != nil { - //if histogram.IsCustomBucketsSchema(s.h.Schema) { - // if ms.lastHistogramValue != nil { - // - // } - //} _, chunkCreated = ms.appendHistogram(s.t, s.h, 0, appendChunkOpts) } else { - //if histogram.IsCustomBucketsSchema(s.fh.Schema) { - // if ms.lastFloatHistogramValue != nil { - // s.h.CustomValues = ms.lastFloatHistogramValue.CustomValues - // } else { - // s.h.CustomValues = ms.customValues - // } - // //customVals := h. - // //s.h.CustomValues = - //} _, chunkCreated = ms.appendFloatHistogram(s.t, s.fh, 0, appendChunkOpts) } if chunkCreated { diff --git a/tsdb/record/record.go b/tsdb/record/record.go index d759c18551..83adecdbb4 100644 --- a/tsdb/record/record.go +++ b/tsdb/record/record.go @@ -52,7 +52,6 @@ const ( HistogramSamples Type = 7 // FloatHistogramSamples is used to match WAL records of type Float Histograms. FloatHistogramSamples Type = 8 - CustomValues Type = 9 ) func (rt Type) String() string { @@ -73,8 +72,6 @@ func (rt Type) String() string { return "mmapmarkers" case Metadata: return "metadata" - case CustomValues: - return "custom_values" default: return "unknown" } @@ -150,11 +147,6 @@ type RefSeries struct { Labels labels.Labels } -type RefCustomValues struct { - Ref chunks.HeadSeriesRef - CustomValues []float64 -} - // RefSample is a timestamp/value pair associated with a reference to a series. // TODO(beorn7): Perhaps make this "polymorphic", including histogram and float-histogram pointers? Then get rid of RefHistogramSample. type RefSample struct { @@ -215,7 +207,7 @@ func (d *Decoder) Type(rec []byte) Type { return Unknown } switch t := Type(rec[0]); t { - case Series, Samples, Tombstones, Exemplars, MmapMarkers, Metadata, HistogramSamples, FloatHistogramSamples, CustomValues: + case Series, Samples, Tombstones, Exemplars, MmapMarkers, Metadata, HistogramSamples, FloatHistogramSamples: return t } return Unknown