[#217] cmd/node: Use local Inhume operation as a redundant copy callback

Exec `StorageEngine.Inhume` operation on redundant copy callback from Object
Policer with `MarkAsGarbage` parameter.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/KirillovDenis/release/v0.21.1
Leonard Lyubich 2021-02-19 18:23:21 +03:00 committed by Alex Vanin
parent 277e3ca20a
commit f1a4b8d322
1 changed files with 8 additions and 0 deletions

View File

@ -202,6 +202,14 @@ func initObjectService(c *cfg) {
c.viper.GetDuration(cfgPolicerHeadTimeout),
),
policer.WithReplicator(repl),
policer.WithRedundantCopyCallback(func(addr *objectSDK.Address) {
_, err := ls.Inhume(new(engine.InhumePrm).MarkAsGarbage(addr))
if err != nil {
c.log.Warn("could not inhume mark redundant copy as garbage",
zap.String("error", err.Error()),
)
}
}),
)
addNewEpochNotificationHandler(c, func(ev event.Event) {