-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename: AtomicBloom to ConcurrentBloom #34483
Rename: AtomicBloom to ConcurrentBloom #34483
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #34483 +/- ##
=======================================
Coverage 81.8% 81.8%
=======================================
Files 822 822
Lines 221504 221504
=======================================
+ Hits 181289 181336 +47
+ Misses 40215 40168 -47 |
Yeah, maybe some better naming of the fn here. maybe |
Yeah I believe @t-nelson is right about the reasoning behind the |
Understood on original reasoning. I think my reasoning makes sense on why I want this structure to be clearable, and I don't care about partial writes for my use case. So seems options going forward are:
I think 2 or 3 makes more sense, but lmk what you guys think. |
|
After sleeping on it, I think I'm leaning towards option 2 in renaming the struct to The existing operations I pushed this in faf7cbd. If you feel strongly 3 was better option lmk. |
faf7cbd
to
826e6d4
Compare
instead of renaming the struct, could add a |
Maybe I'm missing something. The existing unmarked fns for contains and add are already non-atomic. Why do we want to make it less convenient to use clear specifically? |
ah i think i was reviewing a stale commit. figured we had more consumers, but the diff isn't terrible. that crate is a dev-dependency for some other project, but looks like they only use |
Problem
contains
,add
operations are not atomic at the struct level. This should be reflected in the structure name.clear
function takes a mutable reference for no reasonclear
function is namedfor_tests
, but this is a valid operation which I want to use for filtering invalid payer keys, and clearing periodically w/o lockingSummary of Changes
Rename struct
AtomicBloom
toConcurrentBloom
clear
- Take immutable reference, rename toclear
fromclear_for_tests
All read/write operations are not atomic at the struct level, but only at the element level. Renaming the struct makes it clear that operations are not atomic.
Notes on clear
AtomicU64
. This would lead to a key that was just inserted possibly returning false from contains if a concurrent clear was happening.Fixes #