diff --git a/storage/metric/frontier.go b/storage/metric/frontier.go index a1e4b579c..d6d612adb 100644 --- a/storage/metric/frontier.go +++ b/storage/metric/frontier.go @@ -38,6 +38,10 @@ func (f *diskFrontier) String() string { return fmt.Sprintf("diskFrontier from %s at %s to %s at %s", f.firstFingerprint.ToRowKey(), f.firstSupertime, f.lastFingerprint.ToRowKey(), f.lastSupertime) } +func (f *diskFrontier) ContainsFingerprint(fingerprint model.Fingerprint) bool { + return fingerprint.Less(f.firstFingerprint) || f.lastFingerprint.Less(fingerprint) +} + func newDiskFrontier(i iterator) (d *diskFrontier, err error) { i.SeekToLast() if i.Key() == nil { diff --git a/storage/metric/tiered.go b/storage/metric/tiered.go index 92f99a775..2aef30b1b 100644 --- a/storage/metric/tiered.go +++ b/storage/metric/tiered.go @@ -365,7 +365,7 @@ func (t *tieredStorage) renderView(viewJob viewJob) (err error) { ) // fmt.Printf("Starting scan of %s...\n", scanJob) - if !(t.diskFrontier == nil || scanJob.fingerprint.Less(t.diskFrontier.firstFingerprint) || t.diskFrontier.lastFingerprint.Less(scanJob.fingerprint)) { + if t.diskFrontier != nil || t.diskFrontier.ContainsFingerprint(scanJob.fingerprint) { // fmt.Printf("Using diskFrontier %s\n", t.diskFrontier) seriesFrontier, err := newSeriesFrontier(scanJob.fingerprint, *t.diskFrontier, iterator) // fmt.Printf("Using seriesFrontier %s\n", seriesFrontier)