From 78e867e145f1c463da323f227b0aac8084c611d1 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 7 Mar 2021 09:38:31 -0800 Subject: [PATCH] ignore healing .trash, .metacache amd .multipart paths (#11725) --- cmd/erasure-server-pool.go | 15 +++++++++++++++ cmd/global-heal.go | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/cmd/erasure-server-pool.go b/cmd/erasure-server-pool.go index bb7c4a128..0b849bd3d 100644 --- a/cmd/erasure-server-pool.go +++ b/cmd/erasure-server-pool.go @@ -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 diff --git a/cmd/global-heal.go b/cmd/global-heal.go index d7d55625b..74197da34 100644 --- a/cmd/global-heal.go +++ b/cmd/global-heal.go @@ -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)