forked from TrueCloudLab/frostfs-node
[#378] object/delete: Set expiration epoch of the created tombstones
Make object delete service to use network information to calculate and set expiration of the created tombstone. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
717f2beb47
commit
b8d1144839
3 changed files with 43 additions and 0 deletions
|
@ -2,9 +2,11 @@ package deletesvc
|
|||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
||||
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
objectV2 "github.com/nspcc-dev/neofs-api-go/v2/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
|
||||
|
@ -236,6 +238,12 @@ func (exec *execCtx) initTombstoneObject() bool {
|
|||
exec.tombstoneObj.SetType(objectSDK.TypeTombstone)
|
||||
exec.tombstoneObj.SetPayload(payload)
|
||||
|
||||
a := objectSDK.NewAttribute()
|
||||
a.SetKey(objectV2.SysAttributeExpEpoch)
|
||||
a.SetValue(strconv.FormatUint(exec.tombstone.ExpirationEpoch(), 10))
|
||||
|
||||
exec.tombstoneObj.SetAttributes(a)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue