forked from TrueCloudLab/frostfs-node
[#378] shard: Collect expired non-tombstone objects in GC every epoch
Add new epoch event handler to GC that finds all expired non-tombstone objects and marks them to be removed. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
89a22450e5
commit
dab45050b9
2 changed files with 60 additions and 3 deletions
|
@ -40,9 +40,16 @@ func (s *Shard) Init() error {
|
|||
}
|
||||
|
||||
gc := &gc{
|
||||
gcCfg: s.gcCfg,
|
||||
remover: s.removeGarbage,
|
||||
mEventHandler: map[eventType]*eventHandlers{},
|
||||
gcCfg: s.gcCfg,
|
||||
remover: s.removeGarbage,
|
||||
mEventHandler: map[eventType]*eventHandlers{
|
||||
eventNewEpoch: {
|
||||
cancelFunc: func() {},
|
||||
handlers: []eventHandler{
|
||||
s.collectExpiredObjects,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
gc.init()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue