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.
This commit is contained in:
Anis Elleuch 2022-09-01 23:22:11 +01:00 committed by GitHub
parent f649968c69
commit 10e75116ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}