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 f104f3eb2a
commit 576a80b3d9

View file

@ -2833,16 +2833,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)
}
}