vedhavyas / cuckoo-filter

Cuckoo Filter: Practically better than bloom filter
The Unlicense
81 stars 4 forks source link

Encode is not thread safe #12

Closed VirrageS closed 5 years ago

VirrageS commented 5 years ago

Shallow copy is not enough when doing encode. See that here: https://github.com/vedhavyas/cuckoo-filter/blob/master/cuckoo.go#L419 bucket array is only shallow copied. This means if we start encoding and do some delete keys concurrently we might have inconsistencies.

vedhavyas commented 5 years ago

Apologies for late reply. Should be fixed with the above PR and make a release after.