Skip to content

fix(pinmfs): log failed MFS pins by rechecking until pinned - #11492

Open
rhmatzeka wants to merge 1 commit into
ipfs:masterfrom
rhmatzeka:fix/pinmfs-recheck-status
Open

rhmatzeka wants to merge 1 commit into
ipfs:masterfrom
rhmatzeka:fix/pinmfs-recheck-status

Conversation

@rhmatzeka

Copy link
Copy Markdown

Continues #8525 by @gautammenghani, with the review from @gammazero applied, and @gautammenghani kept as co-author.

What changed

Once the MFS root was pinned to a remote service, pinAllMFS skipped that service for as long as MFS kept the same root CID. The pin's status was never read again, so a pin that went from queued to failed was never noticed. This is the case #7917 describes.

Now lastPin keeps the status the service reported and when it was read. While MFS is unchanged:

  • a pin the service reports as pinned is skipped, as before
  • any other status is checked again every MFS.RepinInterval. A failed pin is logged as an error by the existing check in pinMFS (received pre-existing "failed" status) and requested again with Replace

There is no extra goroutine per pin. The recheck runs in the existing polling loop, which was the main point of the review on #8525. When MFS changes, the old MFS.RepinInterval rate limit applies as before.

Tests

TestPinMFSRechecksPinUntilPinned runs pinAllMFS against a fake pinning service and walks the pin through queued, failed (error logged, pin replaced), and pinned (no more checks). It fails on master at the failed step, because the service is never asked again.

  • go test ./cmd/ipfs/kubo/ -run PinMFS and the same with -race
  • go vet ./cmd/ipfs/kubo/

References

Once the MFS root was pinned to a remote service, the pin was never
looked at again while MFS stayed the same, so a pin that later failed
went unnoticed. Keep checking its status every MFS.RepinInterval until
the service reports it as pinned. A failed pin is logged as an error
and requested again.

Co-authored-by: Gautam Menghani <78410304+gautammenghani@users.noreply.github.com>
@rhmatzeka
rhmatzeka requested a review from a team as a code owner November 12, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MFS remote pinning policy: log ERROR if pin failed

1 participant