Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion storage/localstore/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ func (db *DB) removeChunksInExcludeIndexFromGC() (err error) {
gcSizeChange--
}
excludedCount++
db.gcExcludeIndex.DeleteInBatch(batch, item)
}

return false, nil
Expand Down
3 changes: 3 additions & 0 deletions storage/localstore/mode_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ func (db *DB) setPin(batch *leveldb.Batch, addr chunk.Address) (err error) {
// setUnpin decrements pin counter for the chunk by updating pin index.
// Provided batch is updated.
func (db *DB) setUnpin(batch *leveldb.Batch, addr chunk.Address) (err error) {
metricName := "localstore/gc/exclude"
item := addressToItem(addr)

// Get the existing pin counter of the chunk
Expand All @@ -389,6 +390,8 @@ func (db *DB) setUnpin(batch *leveldb.Batch, addr chunk.Address) (err error) {
db.pinIndex.PutInBatch(batch, item)
} else {
db.pinIndex.DeleteInBatch(batch, item)
db.gcExcludeIndex.DeleteInBatch(batch, item)
metrics.GetOrRegisterCounter(metricName+"/excluded-count", nil).Dec(int64(1))
}

return nil
Expand Down