mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
lib/storage: properly set time range when deleting time series
This commit is contained in:
parent
695c1dc5eb
commit
823fa085ef
@ -888,8 +888,12 @@ func (db *indexDB) DeleteTSIDs(tfss []*TagFilters) (int, error) {
|
||||
}
|
||||
|
||||
// Obtain metricIDs to delete.
|
||||
tr := TimeRange{
|
||||
MinTimestamp: 0,
|
||||
MaxTimestamp: (1<<63)-1,
|
||||
}
|
||||
is := db.getIndexSearch()
|
||||
metricIDs, err := is.searchMetricIDs(tfss, TimeRange{}, 1e9)
|
||||
metricIDs, err := is.searchMetricIDs(tfss, tr, 1e12)
|
||||
db.putIndexSearch(is)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
@ -541,7 +541,7 @@ func testStorageDeleteMetrics(s *Storage, workerNum int) error {
|
||||
return fmt.Errorf("cannot delete metrics: %s", err)
|
||||
}
|
||||
if deletedCount == 0 {
|
||||
return fmt.Errorf("expecting non-zero number of deleted metrics")
|
||||
return fmt.Errorf("expecting non-zero number of deleted metrics on iteration %d", i)
|
||||
}
|
||||
if n := metricBlocksCount(tfs); n != 0 {
|
||||
return fmt.Errorf("expecting zero metric blocks after DeleteMetrics call for tfs=%s; got %d blocks", tfs, n)
|
||||
|
Loading…
Reference in New Issue
Block a user