Avoid listing buckets from a suspended pool (#15283)

Make bucket requests sent after decommissioning is started are not
created in a suspended pool. Therefore listing buckets should avoid
suspended pools as well.
This commit is contained in:
Anis Elleuch 2022-07-13 15:44:50 +01:00 committed by GitHub
parent 0a8b78cb84
commit 996cac5fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1652,7 +1652,10 @@ func (z *erasureServerPools) ListBuckets(ctx context.Context) (buckets []BucketI
if z.SinglePool() {
buckets, err = z.serverPools[0].ListBuckets(ctx)
} else {
for _, pool := range z.serverPools {
for idx, pool := range z.serverPools {
if z.IsSuspended(idx) {
continue
}
buckets, err = pool.ListBuckets(ctx)
if err != nil {
logger.LogIf(ctx, err)