-
Notifications
You must be signed in to change notification settings - Fork 112
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
Scalable Bloom Filter panics after ~31 million insertions #29
Comments
Fascinating discovery and sorry you hit this bug! I will take a look and see if I can figure out what's going on. |
So unfortunately the issue is
This shows what's happening: https://play.golang.org/p/fJD2OaXK2Bc I'm not sure what exactly to do here since it is the nature of the scalable bloom filter to add continuously larger filters in order to enforce a tight upper bound on false positives. |
@tylertreat I see, I assume it would take longer to hit this limit if you set a higher |
test the limition of the k. playground: test filters limit package main
import (
"fmt"
"math"
)
func main() {
fp := 0.01
r := 0.8
for i := 100; i < 100000000; i = i + 400 {
fpRate := fp * math.Pow(r, float64(i))
k := math.Ceil(math.Log2(1 / fpRate))
fmt.Printf("%+v,%+v, %+v\n", i, fpRate, k)
_ = make([]*Buckets, uint(k))
}
}
type Buckets struct {
data []byte
bucketSize uint8
max uint8
count uint
}
|
Hey @tylertreat! I noticed that
NewDefaultScalableBloomFilter(0.01)
panics after exactly 31,536,466 insertions. Here is a test case:and here is the test ouput:
The culprit appears to be this line:
BoomFilters/partitioned.go
Line 52 in 611b3db
which confuses me because
k
should be a totally reasonable size, and is only a function offpr
and notn
.The text was updated successfully, but these errors were encountered: