Repository: minio/minio (language: go)

Issue:
Decommissioning fails because of replicated deletemarkers
<!--- Provide a general summary of the issue in the Title above -->
Decommissioning fails because there are still objects on disk. These objects all seem to be replicated deletemarkers. The prior version exists on a different pool, but this version (v2) is a deletemarker and gets replicated/written to the decommissioned pool.

## Expected Behavior
Decommissioned pool is read-only, not a single object-version should on this pool.

## Current Behavior
Decommissioning fails because of still existing objects on the pool. Even when retrying to decommission the pool, there are already new (replicated) deletemarkers on the pool, which causes the decommission to fail again.


## Steps to Reproduce (for bugs)

1. Setup active-active replication between 2 MinIO-clusters
2. Decommission a pool on one or both cluster(s)
3. Delete objects on the other cluster during decommissioning

## Context
When retrying to decommission, these deletemarkers get deleted from the pool, cause they're the only version found on that pool. Which creates a difference between clusters... One cluster has a deletemarker, the other cluster doesn't. While the prior version (the real object) still exists on both clusters.

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used (`minio --version`): minio version RELEASE.2024-10-02T17-50-41Z (commit-id=ded0b19d97bb9f73f4d78382eb131ff80003e272)
* Server setup and configuration:
  2 clusters with same setup (active-active replication):
    pool 1 : 2 nodes (decommissioned / draining)
    pool 2 : 4 nodes (active)
    pool 3: 4 nodes (active)

* Operating System and version (`uname -a`): Linux 6.1.0-0.deb11.21-amd64


Discussion / hints:
this is reproducible, will get back on this

Fix patch:
diff --git a/cmd/erasure-server-pool-decom.go b/cmd/erasure-server-pool-decom.go
index fda8401c61707..418f2570dc5b8 100644
--- a/cmd/erasure-server-pool-decom.go
+++ b/cmd/erasure-server-pool-decom.go
@@ -845,7 +845,7 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
 				// to decommission, just skip it, this also includes
 				// any other versions that have already expired.
 				remainingVersions := len(fivs.Versions) - expired
-				if version.Deleted && remainingVersions == 1 {
+				if version.Deleted && remainingVersions == 1 && rcfg == nil {
 					decommissioned++
 					stopFn(version.Size, errors.New("DELETE marked object with no other non-current versions will be skipped"))
 					continue


Test patch: