fix: prevent accidental removal of valid sector index announcements #1396
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.
Summary
We discovered an issue where when calling the Lotus Storage API we were not properly handling the multiple states that can be returned for a sector (Cache status, Unsealed/Sealed status). This could result in a sector being considered as removed.
This update adds a state to the database to account for the various Cache states a sector may be in. In most instances the Sealed/Unsealed status should ultimately be recorded, but in the instance that is not returned for some reason, we will record the cache status so that the sector is not removed. Only if no status is returned will we consider the sector as removed.
TODO:
Note: This will result in a full index ingest for affected users.