Browse Source

Fix garbage collection about t.droppedSeries in QueueManager.SeriesReset. (#8387)

* Fix memory leak about t.droppedSeries in QueueManager.SeriesReset.

Signed-off-by: kevinForMyself <zise_2001@163.com>

* Fix garbage collection about t.droppedSeries in QueueManager.SeriesReset

Signed-off-by: kevinForMyself <zise_2001@163.com>
pull/8401/head
kevinForMyself 4 years ago committed by GitHub
parent
commit
db445844d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      storage/remote/queue_manager.go

4
storage/remote/queue_manager.go

@ -538,13 +538,15 @@ func (t *QueueManager) StoreSeries(series []record.RefSeries, index int) {
t.seriesMtx.Lock()
defer t.seriesMtx.Unlock()
for _, s := range series {
// Just make sure all the Refs of Series will insert into seriesSegmentIndexes map for tracking.
t.seriesSegmentIndexes[s.Ref] = index
ls := processExternalLabels(s.Labels, t.externalLabels)
lbls := relabel.Process(ls, t.relabelConfigs...)
if len(lbls) == 0 {
t.droppedSeries[s.Ref] = struct{}{}
continue
}
t.seriesSegmentIndexes[s.Ref] = index
t.internLabels(lbls)
// We should not ever be replacing a series labels in the map, but just

Loading…
Cancel
Save