fix: use source_cid in pin cron job #1757
Merged
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.
TLDR; we pin to cluster using
source_cid
, but the pins cron job checks status bycontent_cid
so it is not found. For most data this is not a problem but when v0 CIDs are pinned their status never gets updated toPinned
.This is a long standing bug that was masked by a regression that got fixed recently here: #1634
In Web3.Storage this query is harder so we actually downgrade
content_cid
to v0 when found to be unpinned everywhere and re-check with cluster: https://github.com/web3-storage/web3.storage/blob/3231807f24190de3e5be810ab25ed9567fda41cb/packages/cron/src/jobs/pins.js#L73-L75Fixes #1745