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,6 +2,7 @@ package deletesvc
|
|||
|
||||
import (
|
||||
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func (exec *execCtx) executeLocal() {
|
||||
|
@ -25,7 +26,22 @@ func (exec *execCtx) executeLocal() {
|
|||
}
|
||||
|
||||
func (exec *execCtx) formTombstone() (ok bool) {
|
||||
tsLifetime, err := exec.svc.netInfo.TombstoneLifetime()
|
||||
if err != nil {
|
||||
exec.status = statusUndefined
|
||||
exec.err = err
|
||||
|
||||
exec.log.Debug("could not read tombstone lifetime config",
|
||||
zap.String("error", err.Error()),
|
||||
)
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
exec.tombstone = objectSDK.NewTombstone()
|
||||
exec.tombstone.SetExpirationEpoch(
|
||||
exec.svc.netInfo.CurrentEpoch() + tsLifetime,
|
||||
)
|
||||
exec.addMembers([]*objectSDK.ID{exec.address().ObjectID()})
|
||||
|
||||
exec.log.Debug("forming split info...")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue