diff --git a/compact.go b/compact.go index a1a7aa76f..bf07d25e8 100644 --- a/compact.go +++ b/compact.go @@ -309,7 +309,7 @@ func splitByRange(ds []dirMeta, tr int64) [][]dirMeta { } // Skip blocks that don't fall into the range. This can happen via mis-alignment or // by being the multiple of the intended range. - if ds[i].meta.MinTime < t0 || ds[i].meta.MaxTime > t0+tr { + if m.MaxTime > t0+tr { i++ continue } @@ -317,7 +317,7 @@ func splitByRange(ds []dirMeta, tr int64) [][]dirMeta { // Add all dirs to the current group that are within [t0, t0+tr]. for ; i < len(ds); i++ { // Either the block falls into the next range or doesn't fit at all (checked above). - if ds[i].meta.MinTime < t0 || ds[i].meta.MaxTime > t0+tr { + if ds[i].meta.MaxTime > t0+tr { break } group = append(group, ds[i]) diff --git a/db.go b/db.go index 0022df12d..275d96eb7 100644 --- a/db.go +++ b/db.go @@ -896,7 +896,7 @@ func (db *DB) Snapshot(dir string, withHead bool) error { if dir == db.dir { return errors.Errorf("cannot snapshot into base directory") } - if _, err := ulid.Parse(dir); err == nil { + if _, err := ulid.ParseStrict(dir); err == nil { return errors.Errorf("dir must not be a valid ULID") } @@ -1037,7 +1037,7 @@ func isBlockDir(fi os.FileInfo) bool { if !fi.IsDir() { return false } - _, err := ulid.Parse(fi.Name()) + _, err := ulid.ParseStrict(fi.Name()) return err == nil }