[#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>
This commit is contained in:
Leonard Lyubich 2021-02-19 18:23:21 +03:00 committed by Alex Vanin
parent 277e3ca20a
commit f1a4b8d322

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) {