Do not save empty advertisements to mirror #2471
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.
Empty advertisements should not be saved to mirror since they do not help index ingestion. Advertisements may have no multihash entries when:
When ingesting ads, the indexer does not read removal ads from the mirror since there is no entry data to get.
The indexer stores the metadata, but does not read mirror since there are no entries
Once an ad is known to be deleted, that ad will never be read from the mirror since its content is deleted
This is treated like a no-content ad, as in case 2, but means that at some point in the past the ad had entry data. There is or should be a pending unpublished removal later in the chain. So, do not save this in a mirror since it will end up being deleted later, or may be a temporary publisher error that should be queried by another indexer using the mirror. In either case, the advertisement should not be written to the mirror.
GC also removes any empty (no-content) advertisements from the mirror, and reindexing must not repopulate them.
Other changes: