ignore typed errors correctly in list cache layer (#10879)

bonus write bucket metadata cache with enough quorum

Possible fix for #10868
This commit is contained in:
Harshavardhana
2020-11-12 09:28:56 -08:00
committed by GitHub
parent f86d3538f6
commit ca88ca753c
4 changed files with 47 additions and 41 deletions

View File

@@ -440,7 +440,11 @@ func (d *dataUsageCache) load(ctx context.Context, store objectIO, name string)
var buf bytes.Buffer
err := store.GetObject(ctx, dataUsageBucket, name, 0, -1, &buf, "", ObjectOptions{})
if err != nil {
if !isErrObjectNotFound(err) && !isErrBucketNotFound(err) && !errors.Is(err, InsufficientReadQuorum{}) {
switch err.(type) {
case ObjectNotFound:
case BucketNotFound:
case InsufficientReadQuorum:
default:
return toObjectErr(err, dataUsageBucket, name)
}
*d = dataUsageCache{}