ignore healing .trash, .metacache amd .multipart paths (#11725)

This commit is contained in:
Harshavardhana 2021-03-07 09:38:31 -08:00 committed by GitHub
parent 9ccc483df6
commit 78e867e145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import (
"github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/madmin"
"github.com/minio/minio/pkg/sync/errgroup"
"github.com/minio/minio/pkg/wildcard"
)
type erasureServerPools struct {
@ -1475,6 +1476,20 @@ func (z *erasureServerPools) HealObjects(ctx context.Context, bucket, prefix str
if entry.isDir() {
return
}
// We might land at .metacache, .trash, .multipart
// no need to heal them skip, only when bucket
// is '.minio.sys'
if bucket == minioMetaBucket {
if wildcard.Match("buckets/*/.metacache/*", entry.name) {
return
}
if wildcard.Match("tmp/.trash/*", entry.name) {
return
}
if wildcard.Match("multipart/*", entry.name) {
return
}
}
fivs, err := entry.fileInfoVersions(bucket)
if err != nil {
errCh <- err

View File

@ -27,6 +27,7 @@ import (
"github.com/minio/minio/pkg/color"
"github.com/minio/minio/pkg/console"
"github.com/minio/minio/pkg/madmin"
"github.com/minio/minio/pkg/wildcard"
)
const (
@ -205,6 +206,20 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []BucketIn
if entry.isDir() {
return
}
// We might land at .metacache, .trash, .multipart
// no need to heal them skip, only when bucket
// is '.minio.sys'
if bucket.Name == minioMetaBucket {
if wildcard.Match("buckets/*/.metacache/*", entry.name) {
return
}
if wildcard.Match("tmp/.trash/*", entry.name) {
return
}
if wildcard.Match("multipart/*", entry.name) {
return
}
}
fivs, err := entry.fileInfoVersions(bucket.Name)
if err != nil {
logger.LogIf(ctx, err)