[#1451] ec: Check all parts are saved
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
9a77527f46
commit
3cf6ea745d
1 changed files with 11 additions and 1 deletions
|
@ -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 {
|
||||
Config *Config
|
||||
|
@ -249,6 +252,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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue