diff --git a/lib/storage/index_db.go b/lib/storage/index_db.go index fa98110e8..a2703ac9f 100644 --- a/lib/storage/index_db.go +++ b/lib/storage/index_db.go @@ -2120,7 +2120,8 @@ func (is *indexSearch) tryUpdatingMetricIDsForDateRange(metricIDs *uint64set.Set okGlobal = ok } if err != nil { - errGlobal = fmt.Errorf("cannot search for metricIDs on date %d: %s", date, err) + dateStr := time.Unix(int64(date*24*3600), 0) + errGlobal = fmt.Errorf("cannot search for metricIDs for %s: %s", dateStr, err) } mu.Unlock() }() @@ -2146,7 +2147,7 @@ func (is *indexSearch) tryUpdatingMetricIDsForDate(date uint64, metricIDs *uint6 } var result *uint64set.Set - maxDateMetrics := maxMetrics * 20 + maxDateMetrics := maxMetrics * 50 if tfFirst == nil { result = &uint64set.Set{} if err := is.updateMetricIDsForDateAll(result, date, maxDateMetrics); err != nil { @@ -2156,7 +2157,7 @@ func (is *indexSearch) tryUpdatingMetricIDsForDate(date uint64, metricIDs *uint6 // according to startDateForPerDayInvertedIndex. return true, nil } - return false, fmt.Errorf("cannot obtain all the metricIDs for date %d: %s", date, err) + return false, fmt.Errorf("cannot obtain all the metricIDs: %s", err) } } else { m, err := is.getMetricIDsForDateTagFilter(tfFirst, date, tfs.commonPrefix, maxDateMetrics) @@ -2171,7 +2172,8 @@ func (is *indexSearch) tryUpdatingMetricIDsForDate(date uint64, metricIDs *uint6 result = m } if result.Len() >= maxDateMetrics { - return false, fmt.Errorf("more than %d time series found; narrow down the query or increase `-search.maxUniqueTimeseries`", maxDateMetrics) + // Too many time series found by a single tag filter. Fall back to global search. + return false, nil } for i := range tfs.tfs { @@ -2189,8 +2191,8 @@ func (is *indexSearch) tryUpdatingMetricIDsForDate(date uint64, metricIDs *uint6 return false, err } if m.Len() >= maxDateMetrics { - return false, fmt.Errorf("more than %d time series found for tag filter %s; narrow down the query or increase `-search.maxUniqueTimeseries`", - maxDateMetrics, tf) + // Too many time series found by a single tag filter. Fall back to global search. + return false, nil } if tf.isNegative { result.Subtract(m)