ec: Check all parts are saved #1553
1 changed files with 11 additions and 1 deletions
|
@ -25,7 +25,10 @@ import (
|
||||||
|
|
||||||
var _ transformer.ObjectWriter = (*ecWriter)(nil)
|
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 {
|
type ecWriter struct {
|
||||||
cfg *cfg
|
cfg *cfg
|
||||||
|
@ -235,6 +238,13 @@ func (e *ecWriter) writeRawObject(ctx context.Context, obj *objectSDK.Object) er
|
||||||
singleErr: err,
|
singleErr: err,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for idx := range partsProcessed {
|
||||||
|
if !partsProcessed[idx].Load() {
|
||||||
|
return errIncompletePut{
|
||||||
|
singleErr: errFailedToSaveAllECParts,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue