feat(blockstore): expose BloomCacheStatus and add bloom filter Rebuild#1184
Open
guillaumemichel wants to merge 3 commits into
Open
feat(blockstore): expose BloomCacheStatus and add bloom filter Rebuild#1184guillaumemichel wants to merge 3 commits into
guillaumemichel wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## fix/bloom-incomplete-build #1184 +/- ##
==============================================================
- Coverage 63.75% 63.75% -0.01%
==============================================================
Files 269 269
Lines 27027 27047 +20
==============================================================
+ Hits 17232 17243 +11
- Misses 8081 8086 +5
- Partials 1714 1718 +4
... and 10 files with indirect coverage changes 🚀 New features to boost your workflow:
|
gammazero
approved these changes
Jul 3, 2026
gammazero
left a comment
Contributor
There was a problem hiding this comment.
Everything here looks good.
While not necessary for this PR, it would be if bloomcache.active was changed to a atomic.Bool type.
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.
Builds on top of #1183, which stops the Bloom filter cache from activating
after an incomplete
AllKeysChanenumeration and adds the (unexported)capability to report a truncated enumeration.
This PR makes that machinery observable and recoverable from outside the
package:
Exports the capability as
AllKeysChanWithErrer(AllKeysChanWithErr),so any
Blockstorecan report an error that truncatedAllKeysChanenumeration, and callers can detect it. Forwarded through the same layers as
in fix(blockstore): don't activate bloom cache if build incomplete #1183 (bloomcache, tqcache, idstore, ValidatingBlockstore); stores that
don't implement it fall back to today's best-effort behavior.
Adds
BloomCacheStatus(Wait/BloomActive/Rebuild), implementedby the value
CachedBlockstorereturns when a Bloom filter is configured.Wait/BloomActiveexisted but were unreachable on the unexported cachetype; they're now part of an exported interface, so callers can wait for and
observe the async initial build.
Adds
Rebuild, to retry after a failed initial build (observable viaWait) or refresh a healthy filter. The rebuild runs live: the currentfilter stays active and correct throughout, concurrent writes are mirrored
into the replacement, and the new filter is swapped in atomically only once a
complete enumeration proves it authoritative. A failed or cancelled rebuild
leaves the existing filter in place.
No behavior change for existing callers; all additions are opt-in via the new
interfaces.