From 3d0ca51699983aa9fbfdb5ff6187c28cdff7d08e Mon Sep 17 00:00:00 2001 From: pingqiu Date: Wed, 25 Nov 2026 05:25:17 -0800 Subject: [PATCH] master: a fenced reassign is never skipped as already current The heal of a failed fencing round reassigns the current replica at its own endpoints, which the product tick and the publication admission both dropped as already current. A reassign with a fenced epoch skips that check: the mint takes it only at that epoch, so it cannot advance twice. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/core/host/master/product_loop.go | 5 ++++- seaweed-block/core/host/master/workspace_binding.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/seaweed-block/core/host/master/product_loop.go b/seaweed-block/core/host/master/product_loop.go index 1671cc0d78..5d5751e2d9 100644 --- a/seaweed-block/core/host/master/product_loop.go +++ b/seaweed-block/core/host/master/product_loop.go @@ -123,7 +123,10 @@ func (h *Host) RunLifecycleProductTick() (LifecycleProductTickResult, error) { result.SkippedUnverified++ continue } - if h.assignmentAskAlreadyCurrent(ask.VolumeID, ask.ReplicaID, ask.DataAddr, ask.CtrlAddr) { + // A fenced reassign is minted only at its fenced epoch (a second + // application is refused there), so it is never "already current": + // the heal of a failed fencing round names the current replica. + if ask.Evidence.FencedEpoch == 0 && h.assignmentAskAlreadyCurrent(ask.VolumeID, ask.ReplicaID, ask.DataAddr, ask.CtrlAddr) { result.SkippedCurrent++ continue } diff --git a/seaweed-block/core/host/master/workspace_binding.go b/seaweed-block/core/host/master/workspace_binding.go index 5d9bce2d58..103b43bb93 100644 --- a/seaweed-block/core/host/master/workspace_binding.go +++ b/seaweed-block/core/host/master/workspace_binding.go @@ -239,7 +239,10 @@ func (h *Host) admitWorkspacePublication(ask authority.AssignmentAsk, publish fu // A supported snapshot and its direct promotion fallback may both be // dequeued before either commits. Apply the product loop's existing // already-current check again here, rather than advancing the epoch twice. - if ask.Intent == authority.IntentReassign && h.assignmentAskAlreadyCurrent(ask.VolumeID, ask.ReplicaID, ask.DataAddr, ask.CtrlAddr) { + // A fenced reassign needs no such check: the mint takes it only at its + // fenced epoch, so it cannot advance twice (and the heal of a failed + // fencing round names the current replica on purpose). + if ask.Intent == authority.IntentReassign && ask.Evidence.FencedEpoch == 0 && h.assignmentAskAlreadyCurrent(ask.VolumeID, ask.ReplicaID, ask.DataAddr, ask.CtrlAddr) { return nil } // The same mutex covers Register/Delete. It stays held through the actual