[#885] policer: remove objects for removed container
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
1a1435be3d
commit
7cb3d0cb4a
1 changed files with 14 additions and 0 deletions
|
@ -2,10 +2,13 @@ package policer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
|
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/object"
|
"github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||||
|
"github.com/nspcc-dev/neofs-node/pkg/core/container"
|
||||||
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
||||||
headsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/head"
|
headsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/head"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/services/replicator"
|
"github.com/nspcc-dev/neofs-node/pkg/services/replicator"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
@ -18,6 +21,17 @@ func (p *Policer) processObject(ctx context.Context, addr *object.Address) {
|
||||||
zap.Stringer("cid", addr.ContainerID()),
|
zap.Stringer("cid", addr.ContainerID()),
|
||||||
zap.String("error", err.Error()),
|
zap.String("error", err.Error()),
|
||||||
)
|
)
|
||||||
|
if errors.Is(err, container.ErrNotFound) {
|
||||||
|
prm := new(engine.InhumePrm)
|
||||||
|
prm.MarkAsGarbage(addr)
|
||||||
|
_, err := p.jobQueue.localStorage.Inhume(prm)
|
||||||
|
if err != nil {
|
||||||
|
p.log.Error("could not inhume object with missing container",
|
||||||
|
zap.Stringer("cid", addr.ContainerID()),
|
||||||
|
zap.Stringer("oid", addr.ObjectID()),
|
||||||
|
zap.String("error", err.Error()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue