content: emit warning whenever the number of index blobs gets too high, which is an indication that maintenance has not run in a long time
"github.com/kopia/kopia/repo/hashing"
)
+const indexBlobCompactionWarningThreshold = 100
+
// lockFreeManager contains parts of Manager state that can be accessed without locking
type lockFreeManager struct {
// this one is not lock-free
@@ -119,6 +121,10 @@ func (bm *lockFreeManager) loadPackIndexesUnlocked(ctx context.Context) ([]Index
return nil, false, err
}
+ if len(indexBlobs) > indexBlobCompactionWarningThreshold {
+ log(ctx).Warningf("Found too many index blobs (%v), this may result in degraded performance.\n\nPlease ensure periodic repository maintenance is enabled or run 'kopia maintenance'.", len(indexBlobs))
+ }
+
return indexBlobs, updated, nil
}
