Skip to content

[bugfix] infinite loop with ILM + replication of delete marker and HTTP-405 #153

Closed

Description

@julienlau

Summary
Delete markers carrying a version-purge status (created by ILM NoncurrentVersionExpiration / purge flows) never reach the Completed exit in replicateDeleteToTarget. Each scanner cycle re-probes the target, gets a deterministic 405, falls through to a RemoveObject the delete-on-replica guard blocks, and the version is re-queued. Infinite loop, and every 405 is a protocol success, so no error counter moves.

Mechanism (cmd/bucket-replication.go, replicateDeleteToTarget)

  1. Delete-marker replication starts with a versioned StatObject on the target; a 405 means "marker already present", treated as Completed.
  2. The exit is gated on dobj.VersionID == "" && rinfo.VersionPurgeStatus.Empty() — purge-status markers fail the gate.
  3. Fall-through to RemoveObject on the target; the delete-on-replica guard (cmd/erasure-object.go, markDelete = false) refuses it: deletions only travel source→replica.
  4. Status stays non-Completed → re-queued → next scanner cycle. Deterministic outcome, never converges.

Measurements (site-replication mesh, LOSF, 84M versions, ~86 min scan cycle, ~20M versions stuck from the day ILM rules deployed)

  • 706M replication requests in 48h (~4,100 qps), 96.8% answered 405, ~3% legitimate 2XX.
  • Model matches: stuck_versions × 86,400 / scan_cycle ≈ 343M/day ≈ 685M/48h.
  • Probe rate = scan_rate × stuck_fraction: a scaling phenomenon, no threshold; slowing the scanner divides the storm, fixes nothing.

Suggested fix

  1. Make the 405 probe terminal for delete-marker ops regardless of purge status:
case isErrMethodNotAllowed(serr):
    rinfo.ReplicationStatus = replication.Completed
    if dobj.VersionID != "" && !rinfo.VersionPurgeStatus.Empty() {
        rinfo.VersionPurgeStatus = replication.VersionPurgeComplete
    }
    return rinfo
  1. General rule: never re-enqueue on a deterministic response (405 here; the 404 probe case is already terminal). Only transient errors (network, 503 SlowDown, quorum loss) justify re-queueing.
  2. Observability: replication counters per response code (405 especially) and a gauge of versions with non-Completed status older than N hours. Neither exists natively today.

Full write-up: https://pepitedata.com/minio-site-replication-405-delete-markers/

Activity

  1. changed the title [-][bugfix] infinite loop with ILM + replication of delete marker and HTTP405[/-] [+][bugfix] infinite loop with ILM + replication of delete marker and HTTP-405[/+] on Sep 8, 2026
  2. moved this from Backlog to In progress in Siloon Sep 9, 2026
  3. moved this from In progress to Done in Siloon Sep 9, 2026
  4. Vonng commented on Sep 15, 2026

    @Vonng
    Member

    Resolution update: the reproduced delete-marker purge defects have been addressed in two merged changes.

    A 405 showing that a marker exists is not treated as proof that permanent deletion succeeded. The regression tests check retry behavior and the resulting source and target state, including recovery from persisted MRF entries. The follow-up proposal in #184 has been closed in favor of the merged implementation.

    Documentation:

    As of September 16, these fixes are on main and are not included in Server RELEASE.2026-09-03T13-18-01Z. Final artifact and multi-process acceptance is tracked in #203.

  5. added
    bug
    on Sep 15, 2026
  6. self-assigned this
    on Sep 15, 2026
  7. added theissue type on Sep 15, 2026
  8. added this to the 20260916 milestone on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions