diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index 3fa62692f..172e462db 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -197,7 +197,7 @@ func mustReplicate(ctx context.Context, bucket, object string, mopts mustReplica // Disable server-side replication on object prefixes which are excluded // from versioning via the MinIO bucket versioning extension. - if globalBucketVersioningSys.PrefixSuspended(bucket, object) { + if !globalBucketVersioningSys.PrefixEnabled(bucket, object) { return } @@ -490,7 +490,11 @@ func replicateDelete(ctx context.Context, dobj DeletedObjectReplicationInfo, obj MTime: dobj.DeleteMarkerMTime.Time, DeleteReplication: drs, Versioned: globalBucketVersioningSys.PrefixEnabled(bucket, dobj.ObjectName), - VersionSuspended: globalBucketVersioningSys.PrefixSuspended(bucket, dobj.ObjectName), + // Objects matching prefixes should not leave delete markers, + // dramatically reduces namespace pollution while keeping the + // benefits of replication, make sure to apply version suspension + // only at bucket level instead. + VersionSuspended: globalBucketVersioningSys.Suspended(bucket), }) if err != nil && !isErrVersionNotFound(err) { // VersionNotFound would be reported by pool that object version is missing on. logger.LogIf(ctx, fmt.Errorf("Unable to update replication metadata for %s/%s(%s): %s", bucket, dobj.ObjectName, versionID, err)) diff --git a/cmd/object-api-options.go b/cmd/object-api-options.go index cb75c890d..98cb773b2 100644 --- a/cmd/object-api-options.go +++ b/cmd/object-api-options.go @@ -169,7 +169,11 @@ func delOpts(ctx context.Context, r *http.Request, bucket, object string) (opts return opts, err } opts.Versioned = globalBucketVersioningSys.PrefixEnabled(bucket, object) - opts.VersionSuspended = globalBucketVersioningSys.PrefixSuspended(bucket, object) + // Objects matching prefixes should not leave delete markers, + // dramatically reduces namespace pollution while keeping the + // benefits of replication, make sure to apply version suspension + // only at bucket level instead. + opts.VersionSuspended = globalBucketVersioningSys.Suspended(bucket) delMarker := strings.TrimSpace(r.Header.Get(xhttp.MinIOSourceDeleteMarker)) if delMarker != "" { switch delMarker {