[#1553] ec: Check all parts are saved
Some checks failed
DCO action / DCO (pull_request) Successful in 4m6s
Vulncheck / Vulncheck (pull_request) Successful in 5m35s
Build / Build Components (pull_request) Successful in 6m18s
Tests and linters / gopls check (pull_request) Failing after 6m13s
Tests and linters / Staticcheck (pull_request) Successful in 6m25s
Tests and linters / Tests with -race (pull_request) Successful in 6m28s
Pre-commit hooks / Pre-commit (pull_request) Successful in 6m45s
Tests and linters / Tests (pull_request) Successful in 6m52s
Tests and linters / Lint (pull_request) Successful in 7m44s

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-12-11 13:19:52 +03:00
parent ce55e1579b
commit 1f3e09647a
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0

View file

@ -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
}