Do not allow to delete or lock EC chunks #1213

Merged
fyrchik merged 4 commits from dstepanov-yadro/frostfs-node:fix/lock_ec_chunk into master 2024-07-01 06:49:41 +00:00
Showing only changes of commit 6a91df9138 - Show all commits

View file

@ -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()