Skip to content

Commit 5168ff6

Browse files
committed
abandoned blob scanner: report unreferenced blobs
closes #97
1 parent 1a18845 commit 5168ff6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

pkg/stoserver/commandhandlersdatamanagement.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ func (c *cHandlers) DatabaseScanAbandoned(cmd *stoservertypes.DatabaseScanAbando
512512
logl := logex.Levels(logex.Prefix("abandonedscanner", c.logger))
513513

514514
blobCount := 0
515+
abandoned := 0
515516
totalSize := uint64(0)
516517

517518
knownEncryptionKeys := map[string]bool{}
@@ -549,13 +550,19 @@ func (c *cHandlers) DatabaseScanAbandoned(cmd *stoservertypes.DatabaseScanAbando
549550
blob.EncryptionKeyID)
550551
}
551552

553+
if !blob.Referenced {
554+
abandoned++
555+
logl.Error.Printf("Abandoned Blob[%s]", blob.Ref.AsHex())
556+
}
557+
552558
return nil
553559
}, tx); err != nil {
554560
return err
555561
}
556562

557563
logl.Info.Printf(
558-
"Completed with %d blob(s) with total size (not counting redundancy) %s scanned",
564+
"%d/%d abandoned blob(s) with total size (not counting redundancy) %s scanned",
565+
abandoned,
559566
blobCount,
560567
byteshuman.Humanize(totalSize))
561568

0 commit comments

Comments
 (0)