From 091845df39433fc50131372955899d90be9f9bd4 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 29 Apr 2021 10:00:03 -0700 Subject: [PATCH] fix: return quorum error upon decode failures (#12184) --- cmd/erasure-decode.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmd/erasure-decode.go b/cmd/erasure-decode.go index f92552a25..c3df6b84f 100644 --- a/cmd/erasure-decode.go +++ b/cmd/erasure-decode.go @@ -198,6 +198,18 @@ func (p *parallelReader) Read(dst [][]byte) ([][]byte, error) { return newBuf, nil } + if countErrs(p.errs, nil) == len(p.errs) { + // We have success from all drives this can mean that + // all local drives succeeded, but all remote drives + // failed to read since p.readers[i] was already nil + // for such remote servers - this condition was missed + // we would return instead `nil, nil` from this + // function - it is safer to simply return Quorum error + // when all errs are nil but erasure coding cannot decode + // the content. + return nil, errErasureReadQuorum + } + return nil, reduceReadQuorumErrs(context.Background(), p.errs, objectOpIgnoredErrs, p.dataBlocks) }