From b733e6e83cee28820e815787b0562d17b14f9759 Mon Sep 17 00:00:00 2001 From: Poorna Date: Fri, 15 Sep 2023 18:01:47 -0700 Subject: [PATCH] site replication turn off retry login for admin API calls (#18039) additionally also mark site offline if n/w is down --- cmd/common-main.go | 3 ++- cmd/site-replication.go | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/common-main.go b/cmd/common-main.go index e83535ca2..6d295c00e 100644 --- a/cmd/common-main.go +++ b/cmd/common-main.go @@ -113,9 +113,10 @@ func init() { shardDiskTimeDelta = 1 * time.Minute } - // All minio-go API operations shall be performed only once, + // All minio-go and madmin-go API operations shall be performed only once, // another way to look at this is we are turning off retries. minio.MaxRetry = 1 + madmin.MaxRetry = 1 } const consolePrefix = "CONSOLE_" diff --git a/cmd/site-replication.go b/cmd/site-replication.go index 171173d93..ef7040c6e 100644 --- a/cmd/site-replication.go +++ b/cmd/site-replication.go @@ -35,6 +35,7 @@ import ( "time" "github.com/minio/madmin-go/v3" + "github.com/minio/minio-go/v7" minioClient "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" "github.com/minio/minio-go/v7/pkg/replication" @@ -2119,6 +2120,13 @@ func (c *SiteReplicationSys) concDo(selfActionFn func() error, peerActionFn func errMap := make(map[string]error, len(c.state.Peers)) for i, depID := range depIDs { errMap[depID] = errs[i] + if errs[i] != nil && minio.IsNetworkOrHostDown(errs[i], true) { + ep := c.state.Peers[depID].Endpoint + epURL, _ := url.Parse(ep) + if !globalBucketTargetSys.isOffline(epURL) { + globalBucketTargetSys.markOffline(epURL) + } + } } return c.newConcErr(errMap, actionName) }