From a1c4d0075028378d6929b823449de03e94ce8b5c Mon Sep 17 00:00:00 2001 From: Haleygo Date: Tue, 11 Apr 2023 01:16:36 +0800 Subject: [PATCH] fix sort pendingDateMetricsIDs (#4102) --- lib/storage/storage.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/storage/storage.go b/lib/storage/storage.go index 72f50c50f..ed15d11cd 100644 --- a/lib/storage/storage.go +++ b/lib/storage/storage.go @@ -1289,13 +1289,15 @@ func (s *Storage) DeleteSeries(qt *querytracer.Tracer, tfss []*TagFilters) (int, // SearchLabelNamesWithFiltersOnTimeRange searches for label names matching the given tfss on tr. func (s *Storage) SearchLabelNamesWithFiltersOnTimeRange(qt *querytracer.Tracer, accountID, projectID uint32, tfss []*TagFilters, tr TimeRange, - maxLabelNames, maxMetrics int, deadline uint64) ([]string, error) { + maxLabelNames, maxMetrics int, deadline uint64, +) ([]string, error) { return s.idb().SearchLabelNamesWithFiltersOnTimeRange(qt, accountID, projectID, tfss, tr, maxLabelNames, maxMetrics, deadline) } // SearchLabelValuesWithFiltersOnTimeRange searches for label values for the given labelName, filters and tr. func (s *Storage) SearchLabelValuesWithFiltersOnTimeRange(qt *querytracer.Tracer, accountID, projectID uint32, labelName string, tfss []*TagFilters, - tr TimeRange, maxLabelValues, maxMetrics int, deadline uint64) ([]string, error) { + tr TimeRange, maxLabelValues, maxMetrics int, deadline uint64, +) ([]string, error) { return s.idb().SearchLabelValuesWithFiltersOnTimeRange(qt, accountID, projectID, labelName, tfss, tr, maxLabelValues, maxMetrics, deadline) } @@ -1305,7 +1307,8 @@ func (s *Storage) SearchLabelValuesWithFiltersOnTimeRange(qt *querytracer.Tracer // // If more than maxTagValueSuffixes suffixes is found, then only the first maxTagValueSuffixes suffixes is returned. func (s *Storage) SearchTagValueSuffixes(qt *querytracer.Tracer, accountID, projectID uint32, tr TimeRange, tagKey, tagValuePrefix string, - delimiter byte, maxTagValueSuffixes int, deadline uint64) ([]string, error) { + delimiter byte, maxTagValueSuffixes int, deadline uint64, +) ([]string, error) { return s.idb().SearchTagValueSuffixes(qt, accountID, projectID, tr, tagKey, tagValuePrefix, delimiter, maxTagValueSuffixes, deadline) } @@ -2105,7 +2108,7 @@ func (s *Storage) updatePerDateData(rows []rawRow, mrs []*MetricRow) error { sort.Slice(pendingDateMetricIDs, func(i, j int) bool { a := pendingDateMetricIDs[i] b := pendingDateMetricIDs[j] - if a.accountID != b.projectID { + if a.accountID != b.accountID { return a.accountID < b.accountID } if a.projectID != b.projectID {