forked from TrueCloudLab/frostfs-node
[#378] shard: Collect expired tombstones in GC every epoch
Add new epoch event handler to GC that finds all expired tombstones and marks them and underlying objects to be removed. Shard uses callbacks provided by the storage engine to mark underlying objects. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3d5169c4c9
commit
717f2beb47
5 changed files with 114 additions and 1 deletions
|
@ -29,7 +29,10 @@ func (e *StorageEngine) AddShard(opts ...shard.Option) (*shard.ID, error) {
|
|||
return nil, errors.Wrap(err, "could not generate shard ID")
|
||||
}
|
||||
|
||||
e.shards[id.String()] = shard.New(append(opts, shard.WithID(id))...)
|
||||
e.shards[id.String()] = shard.New(append(opts,
|
||||
shard.WithID(id),
|
||||
shard.WithExpiredObjectsCallback(e.processExpiredTombstones),
|
||||
)...)
|
||||
|
||||
return id, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue