reload from drive tier-config when in-memory cache is not found (#19527)

avoid probing tier target while reloading() tier config
This commit is contained in:
Harshavardhana
2024-04-16 22:09:58 -07:00
committed by GitHub
parent a8d601b64a
commit f65dd3e5a2
5 changed files with 25 additions and 21 deletions

View File

@@ -131,7 +131,7 @@ type remoteVersionID string
// newWarmBackend instantiates the tier type specific WarmBackend, runs
// checkWarmBackend on it.
func newWarmBackend(ctx context.Context, tier madmin.TierConfig) (d WarmBackend, err error) {
func newWarmBackend(ctx context.Context, tier madmin.TierConfig, probe bool) (d WarmBackend, err error) {
switch tier.Type {
case madmin.S3:
d, err = newWarmBackendS3(*tier.S3, tier.Name)
@@ -148,9 +148,11 @@ func newWarmBackend(ctx context.Context, tier madmin.TierConfig) (d WarmBackend,
return nil, errTierTypeUnsupported
}
err = checkWarmBackend(ctx, d)
if err != nil {
return nil, err
if probe {
if err = checkWarmBackend(ctx, d); err != nil {
return nil, err
}
}
return d, nil
}