mirror of
https://github.com/kopia/kopia.git
synced 2026-05-07 14:26:51 -04:00
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
This commit is contained in:
committed by
Julio López
parent
960c33475e
commit
6bc47cb399
@@ -19,6 +19,8 @@
|
||||
"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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user