diff --git a/pkg/local_object_storage/engine/inhume.go b/pkg/local_object_storage/engine/inhume.go index 24fca3b3..d82f0e64 100644 --- a/pkg/local_object_storage/engine/inhume.go +++ b/pkg/local_object_storage/engine/inhume.go @@ -32,7 +32,7 @@ var errInhumeFailure = errors.New("inhume operation failed") // Inhume calls metabase. Inhume method to mark object as removed. It won't be // removed physically from shard until `Delete` operation. func (e *StorageEngine) Inhume(prm *InhumePrm) (*InhumeRes, error) { - shPrm := new(shard.InhumePrm).WithTarget(prm.addr, prm.tombstone) + shPrm := new(shard.InhumePrm).WithTarget(prm.tombstone, prm.addr) res := e.inhume(prm.addr, shPrm, true) if res == nil { diff --git a/pkg/local_object_storage/shard/inhume.go b/pkg/local_object_storage/shard/inhume.go index 0246a477..b81901eb 100644 --- a/pkg/local_object_storage/shard/inhume.go +++ b/pkg/local_object_storage/shard/inhume.go @@ -8,21 +8,21 @@ import ( // InhumePrm encapsulates parameters for inhume operation. type InhumePrm struct { - target *objectSDK.Address + target []*objectSDK.Address tombstone *objectSDK.Address } // InhumeRes encapsulates results of inhume operation. type InhumeRes struct{} -// WithTarget sets object address that should be inhumed and tombstone address +// WithTarget sets list of objects that should be inhumed and tombstone address // as the reason for inhume operation. // -// Arguments should not be nil. +// tombstone should not be nil, addr should not be empty. // Should not be called along with MarkAsGarbage. -func (p *InhumePrm) WithTarget(addr, tombstone *objectSDK.Address) *InhumePrm { +func (p *InhumePrm) WithTarget(tombstone *objectSDK.Address, addrs ...*objectSDK.Address) *InhumePrm { if p != nil { - p.target = addr + p.target = addrs p.tombstone = tombstone } @@ -32,7 +32,7 @@ func (p *InhumePrm) WithTarget(addr, tombstone *objectSDK.Address) *InhumePrm { // MarkAsGarbage marks object to be physically removed from shard. // // Should not be called along with WithTarget. -func (p *InhumePrm) MarkAsGarbage(addr *objectSDK.Address) *InhumePrm { +func (p *InhumePrm) MarkAsGarbage(addr ...*objectSDK.Address) *InhumePrm { if p != nil { p.target = addr p.tombstone = nil @@ -44,7 +44,7 @@ func (p *InhumePrm) MarkAsGarbage(addr *objectSDK.Address) *InhumePrm { // Inhume calls metabase. Inhume method to mark object as removed. It won't be // removed physically from blobStor and metabase until `Delete` operation. func (s *Shard) Inhume(prm *InhumePrm) (*InhumeRes, error) { - metaPrm := new(meta.InhumePrm).WithAddress(prm.target) + metaPrm := new(meta.InhumePrm).WithAddresses(prm.target...) if prm.tombstone != nil { metaPrm.WithTombstoneAddress(prm.tombstone) diff --git a/pkg/local_object_storage/shard/inhume_test.go b/pkg/local_object_storage/shard/inhume_test.go index 1c3b3c4a..14cab27a 100644 --- a/pkg/local_object_storage/shard/inhume_test.go +++ b/pkg/local_object_storage/shard/inhume_test.go @@ -38,7 +38,7 @@ func testShardInhume(t *testing.T, sh *shard.Shard) { putPrm.WithObject(obj.Object()) inhPrm := new(shard.InhumePrm) - inhPrm.WithTarget(obj.Object().Address(), ts.Object().Address()) + inhPrm.WithTarget(ts.Object().Address(), obj.Object().Address()) getPrm := new(shard.GetPrm) getPrm.WithAddress(obj.Object().Address())