From dc2867682fb89c10618a463ce7d422f39c12ca4f Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 28 Jun 2024 16:22:37 +0300 Subject: [PATCH] [#1213] deleteSvc: Do not allow to delete EC chunks Signed-off-by: Dmitrii Stepanov --- pkg/services/object/delete/exec.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/services/object/delete/exec.go b/pkg/services/object/delete/exec.go index 22928dcd5..c2f92950f 100644 --- a/pkg/services/object/delete/exec.go +++ b/pkg/services/object/delete/exec.go @@ -17,6 +17,8 @@ import ( "go.uber.org/zap" ) +var errDeleteECChunk = errors.New("invalid operation: delete EC object chunk") + type execCtx struct { svc *Service @@ -66,13 +68,16 @@ func (exec *execCtx) newAddress(id oid.ID) oid.Address { } func (exec *execCtx) formExtendedInfo(ctx context.Context) error { - _, err := exec.svc.header.head(ctx, exec) + obj, err := exec.svc.header.head(ctx, exec) var errSplitInfo *objectSDK.SplitInfoError var errECInfo *objectSDK.ECInfoError switch { case err == nil: + if ech := obj.ECHeader(); ech != nil { + return errDeleteECChunk + } return nil case errors.As(err, &errSplitInfo): exec.splitInfo = errSplitInfo.SplitInfo()