Repository navigation
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,
pinAllMFSskipped 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 fromqueuedtofailedwas never noticed. This is the case #7917 describes.Now
lastPinkeeps the status the service reported and when it was read. While MFS is unchanged:pinnedis skipped, as beforeMFS.RepinInterval. Afailedpin is logged as an error by the existing check inpinMFS(received pre-existing "failed" status) and requested again withReplaceThere 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.RepinIntervalrate limit applies as before.Tests
TestPinMFSRechecksPinUntilPinnedrunspinAllMFSagainst a fake pinning service and walks the pin throughqueued,failed(error logged, pin replaced), andpinned(no more checks). It fails onmasterat thefailedstep, because the service is never asked again.go test ./cmd/ipfs/kubo/ -run PinMFSand the same with-racego vet ./cmd/ipfs/kubo/References