mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
fix(master): re-issue a runtime RF1 line to the process now holding it
When the direct path finds the line current by address but the slot's reported incarnation is not the line's (a restarted holder, or a move target whose line names no process), it submits the existing endpoint refresh (IntentRefreshEndpoint with that incarnation), as the topology controller does for a static volume (endpointStale, refreshAsk). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f69ca9091b
commit
cc4ea78531
1 file changed
+34
-2
@@ -161,8 +161,12 @@ func (h *Host) RunLifecycleProductTick() (LifecycleProductTickResult, error) {
|
||||
continue
|
||||
}
|
||||
if h.assignmentAskAlreadyCurrent(ask.VolumeID, ask.ReplicaID, ask.DataAddr, ask.CtrlAddr) {
|
||||
result.SkippedCurrent++
|
||||
continue
|
||||
refresh, restarted := h.restartedHolderRefresh(ask)
|
||||
if !restarted {
|
||||
result.SkippedCurrent++
|
||||
continue
|
||||
}
|
||||
ask = refresh
|
||||
}
|
||||
if err := h.ctrl.SubmitAssignmentAsk(ask); err != nil {
|
||||
return result, err
|
||||
@@ -173,6 +177,34 @@ func (h *Host) RunLifecycleProductTick() (LifecycleProductTickResult, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// restartedHolderRefresh: the current line is this RF1 slot's at these
|
||||
// addresses, but the process reporting the slot there now is not the one
|
||||
// the line was issued for (a restarted holder, which refuses the dead
|
||||
// process's line). It returns the endpoint refresh that re-issues the line
|
||||
// for the reported process, as the topology controller does for a volume of
|
||||
// its static topology (endpointStale, refreshAsk).
|
||||
func (h *Host) restartedHolderRefresh(ask authority.AssignmentAsk) (authority.AssignmentAsk, bool) {
|
||||
if h.obs == nil {
|
||||
return authority.AssignmentAsk{}, false
|
||||
}
|
||||
line, ok := h.Publisher().VolumeAuthorityLine(ask.VolumeID)
|
||||
if !ok {
|
||||
return authority.AssignmentAsk{}, false
|
||||
}
|
||||
slot, ok := h.obs.Store().SlotFactAt(ask.VolumeID, ask.ReplicaID, ask.DataAddr, ask.CtrlAddr)
|
||||
if !ok || slot.Incarnation == "" || slot.Incarnation == line.Incarnation {
|
||||
return authority.AssignmentAsk{}, false
|
||||
}
|
||||
return authority.AssignmentAsk{
|
||||
VolumeID: ask.VolumeID,
|
||||
ReplicaID: ask.ReplicaID,
|
||||
DataAddr: ask.DataAddr,
|
||||
CtrlAddr: ask.CtrlAddr,
|
||||
Intent: authority.IntentRefreshEndpoint,
|
||||
Incarnation: slot.Incarnation,
|
||||
}, true
|
||||
}
|
||||
|
||||
func (h *Host) submitPlacementSnapshots(placements []lifecycle.PlacementIntent) (bool, int, int, []authority.AssignmentAsk, error) {
|
||||
placements = h.readyPlacements(placements)
|
||||
captured := placements
|
||||
|
||||
Reference in new issue
Block a user