From 10e75116ef225244b6f639fb56a2f156b96957b4 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Thu, 1 Sep 2022 23:22:11 +0100 Subject: [PATCH] Avoid replicating dirs in listing with replication enabled (#15641) When replication is enabled in a particular bucket, the listing will send objects to bucket replication, but it is also sending prefixes for non recursive listing which is useless and shows a lot of error logs. This commit will ignore prefixes. --- cmd/bucket-replication.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index a7ed3981d..ce37f4627 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -2401,8 +2401,8 @@ func getReplicationDiff(ctx context.Context, objAPI ObjectLayer, bucket string, // QueueReplicationHeal is a wrapper for queueReplicationHeal func QueueReplicationHeal(ctx context.Context, bucket string, oi ObjectInfo) { - // un-versioned case - if oi.VersionID == "" { + // un-versioned or a prefix + if oi.VersionID == "" || oi.ModTime.IsZero() { return } rcfg, _, _ := globalBucketMetadataSys.GetReplicationConfig(ctx, bucket) @@ -2416,8 +2416,8 @@ func QueueReplicationHeal(ctx context.Context, bucket string, oi ObjectInfo) { // queueReplicationHeal enqueues objects that failed replication OR eligible for resyncing through // an ongoing resync operation or via existing objects replication configuration setting. func queueReplicationHeal(ctx context.Context, bucket string, oi ObjectInfo, rcfg replicationConfig) (roi ReplicateObjectInfo) { - // un-versioned case - if oi.VersionID == "" { + // un-versioned or a prefix + if oi.VersionID == "" || oi.ModTime.IsZero() { return roi }