From 1f3e09647a582ced9ef513552427260550c2a8f5 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 11 Dec 2024 13:19:52 +0300 Subject: [PATCH] [#1553] ec: Check all parts are saved Signed-off-by: Dmitrii Stepanov --- pkg/services/object/put/ec.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkg/services/object/put/ec.go b/pkg/services/object/put/ec.go index ad94e9679..b15307cff 100644 --- a/pkg/services/object/put/ec.go +++ b/pkg/services/object/put/ec.go @@ -25,7 +25,10 @@ import ( var _ transformer.ObjectWriter = (*ecWriter)(nil) -var errUnsupportedECObject = errors.New("object is not supported for erasure coding") +var ( + errUnsupportedECObject = errors.New("object is not supported for erasure coding") + errFailedToSaveAllECParts = errors.New("failed to save all EC parts") +) type ecWriter struct { cfg *cfg @@ -235,6 +238,13 @@ func (e *ecWriter) writeRawObject(ctx context.Context, obj *objectSDK.Object) er singleErr: err, } } + for idx := range partsProcessed { + if !partsProcessed[idx].Load() { + return errIncompletePut{ + singleErr: errFailedToSaveAllECParts, + } + } + } return nil }