diff --git a/pkg/services/object/delete/service.go b/pkg/services/object/delete/service.go index 82c7ae2f..c24fcb34 100644 --- a/pkg/services/object/delete/service.go +++ b/pkg/services/object/delete/service.go @@ -9,6 +9,7 @@ import ( headsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/head" putsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/put" objutil "github.com/nspcc-dev/neofs-node/pkg/services/object/util" + "github.com/nspcc-dev/neofs-node/pkg/services/object_manager/placement" "github.com/pkg/errors" ) @@ -78,9 +79,14 @@ func (s *Service) Delete(ctx context.Context, prm *Prm) (*Response, error) { return nil, errors.Wrapf(err, "(%T) could not open put stream", s) } + // `WithoutSuccessTracking` option broadcast message to all container nodes. + // For now there is no better solution to distributed tombstones with + // content address storage (CAS) and one tombstone for several split + // objects. if err := r.Init(new(putsvc.PutInitPrm). WithObject(newTombstone(ownerID, prm.addr.GetContainerID())). - WithCommonPrm(prm.common), + WithCommonPrm(prm.common). + WithTraverseOption(placement.WithoutSuccessTracking()), // broadcast tombstone, maybe one ); err != nil { return nil, errors.Wrapf(err, "(%T) could not initialize tombstone stream", s) } diff --git a/pkg/services/object/put/prm.go b/pkg/services/object/put/prm.go index efdabe10..55c52d12 100644 --- a/pkg/services/object/put/prm.go +++ b/pkg/services/object/put/prm.go @@ -26,6 +26,14 @@ func (p *PutInitPrm) WithCommonPrm(v *util.CommonPrm) *PutInitPrm { return p } +func (p *PutInitPrm) WithTraverseOption(opt placement.Option) *PutInitPrm { + if p != nil { + p.traverseOpts = append(p.traverseOpts, opt) + } + + return p +} + func (p *PutInitPrm) WithObject(v *object.RawObject) *PutInitPrm { if p != nil { p.hdr = v diff --git a/pkg/services/object/put/streamer.go b/pkg/services/object/put/streamer.go index 6732c119..2c271bb9 100644 --- a/pkg/services/object/put/streamer.go +++ b/pkg/services/object/put/streamer.go @@ -91,9 +91,6 @@ func (p *Streamer) preparePrm(prm *PutInitPrm) error { return errors.Wrapf(err, "(%T) could not get container by ID", p) } - // allocate placement traverser options - prm.traverseOpts = make([]placement.Option, 0, 4) - // add common options prm.traverseOpts = append(prm.traverseOpts, // set processing container