From a63b69e9e29f0082b829934796d22cdd499888eb Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 27 Aug 2019 14:20:53 +0300 Subject: [PATCH] lib/storage: report proper maxMetrics limit when more than -search.maxUniqueTimeseries series match the given filters --- lib/storage/index_db.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/storage/index_db.go b/lib/storage/index_db.go index e94b6b9f7d..86b0bf41c9 100644 --- a/lib/storage/index_db.go +++ b/lib/storage/index_db.go @@ -939,6 +939,9 @@ func (db *indexDB) DeleteTSIDs(tfss []*TagFilters) (int, error) { // Reset TagFilters -> TSIDS cache, since it may contain deleted TSIDs. _ = db.invalidateTagCache(accountID, projectID) + // Do not reset uselessTagFiltersCache, since the found metricIDs + // on cache miss are filtered out later with deletedMetricIDs. + // Delete TSIDs in the extDB. if db.doExtDB(func(extDB *indexDB) { var n int @@ -1336,7 +1339,7 @@ func (is *indexSearch) getTagFilterWithMinMetricIDsCountOptimized(tfs *TagFilter return nil, nil, err } return nil, nil, fmt.Errorf("more than %d time series found on the time range %s; either increase -search.maxUniqueTimeseries or shrink the time range", - maxTimeRangeMetrics, tr.String()) + maxMetrics, tr.String()) } const maxDaysForDateMetricIDs = 40