Skip to content

fix(sealing): schedule local moves to long-term storage with DisallowRemoteFinalize - #13948

Open
hmdsefi wants to merge 3 commits into
filecoin-project:masterfrom
hmdsefi:fix/move-selector-local-finalize
Open

hmdsefi wants to merge 3 commits into
filecoin-project:masterfrom
hmdsefi:fix/move-selector-local-finalize

Conversation

@hmdsefi

@hmdsefi hmdsefi commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Related Issues

Fixes #9946

Proposed Changes

  • moveSelector.Ok now prefers a worker that has the sector in one of its paths and also has a destination path. Before, it preferred a worker only when the sector was already in one of the destination paths.
  • workerPaths in Ok is now a set, since the per-path count isn't used anymore.
  • Add TestMoveSelectorPrefersLocalMove. It runs the selector with remote finalize allowed and disallowed, for a worker with both the sealing path and a long-term storage path, a worker with only the storage path, and a worker with only the sealing path.
  • CHANGELOG entry.

Additional Info

DisallowRemoteFinalize is documented as forcing Finalize tasks "to run on workers with local access to both long-term storage and the sealing path containing the sector". When it's set, newMoveSelector gets allowRemote = false and Ok returns (ok && s.allowRemote) || pref, so only preferred workers pass. pref was set only when a path returned by StorageBestAlloc, which is a long-term storage path, already had the sector. After sealing the sector is in a sealing path, so no worker was ever preferred and the seal/v0/fetch request from FinalizeSector stayed in the queue. That is the state in the issue: sched-diag shows the fetch request, and every worker has both the sealing path with the sector (5ba861fb...) and the storage path (70ad46e2...).

The comment in the selector already said the preferred case covers "a local move", so the code now does what the comment says.

With remote finalize allowed, which is the default, this also changes which worker gets the move. A worker that can move the sector locally is now preferred over one that has to fetch it from another machine. Before, every worker with a long-term storage path was equal and the one with the lowest utilization won. I think the new behavior is the intended one, but it is a change, so I'm calling it out.

#10697 is a separate problem in the same selector, when the storage path is full. I'm sending a separate PR for it. The two change different parts of Ok and merge without conflicts.

Tests:

  • go test ./storage/sealer/... passes.
  • With the selector_move.go change reverted, TestMoveSelectorPrefersLocalMove fails: with remote finalize disallowed the worker with both paths is rejected, and with it allowed that worker isn't preferred.
  • gofmt, go vet and golangci-lint v1.64.8 report no issues for ./storage/sealer/....

Checklist

Before you mark the PR ready for review, please make sure that:

…RemoteFinalize

The move selector only preferred a worker when the sector was already in
one of the destination paths, so a move from a sealing path to a
long-term storage path on the same worker was never preferred. With
DisallowRemoteFinalize only preferred workers are accepted, so the fetch
task for FinalizeSector stayed in the scheduler queue forever.

Prefer a worker that has the sector in one of its paths and also has a
destination path.

Fixes filecoin-project#9946
@hmdsefi
hmdsefi requested a review from rvagg as a code owner October 21, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📌 Triage

Development

Successfully merging this pull request may close these issues.

Sector stuck in FinalizeSector state with DisallowRemoteFinalize=true and all Seal/Store storages on all workers.

1 participant