Add number of offline disks in quorum errors (#16822)

This commit is contained in:
Anis Eleuch
2023-05-25 17:39:06 +01:00
committed by GitHub
parent 443250d135
commit 54c5c88fe6
10 changed files with 49 additions and 38 deletions

View File

@@ -19,6 +19,7 @@ package cmd
import (
"context"
"fmt"
"io"
"sync"
@@ -70,7 +71,9 @@ func (p *parallelWriter) Write(ctx context.Context, blocks [][]byte) error {
if nilCount >= p.writeQuorum {
return nil
}
return reduceWriteQuorumErrs(ctx, p.errs, objectOpIgnoredErrs, p.writeQuorum)
writeErr := reduceWriteQuorumErrs(ctx, p.errs, objectOpIgnoredErrs, p.writeQuorum)
return fmt.Errorf("%w (offline-disks=%d/%d)", writeErr, countErrs(p.errs, errDiskNotFound), len(p.writers))
}
// Encode reads from the reader, erasure-encodes the data and writes to the writers.