lib/storage: do not modify filterLoopsCount stats with loopsCount stats

Such a modification can result in incorrect filter sorting later
This commit is contained in:
Aliaksandr Valialkin 2021-03-17 00:38:23 +02:00
parent b997f4a418
commit e2a0c8bd72

View file

@ -2858,16 +2858,8 @@ func (is *indexSearch) getMetricIDsForDateAndFilters(date uint64, tfs *TagFilter
return int64Max
}
storeLoopsCount := func(tfw *tagFilterWithWeight, loopsCount int64) {
needStore := false
if loopsCount != tfw.loopsCount {
tfw.loopsCount = loopsCount
needStore = true
}
if loopsCount > tfw.filterLoopsCount {
tfw.filterLoopsCount = loopsCount
needStore = true
}
if needStore {
is.storeLoopsCountForDateFilter(date, tfw.tf, tfw.loopsCount, tfw.filterLoopsCount)
}
}