Skip to content

fix: remove bloom filter check on Put call in blockstore #3782

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

Merged
merged 1 commit into from
Mar 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions blocks/blockstore/bloom_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ func (b *bloomcache) Get(k *cid.Cid) (blocks.Block, error) {
}

func (b *bloomcache) Put(bl blocks.Block) error {
if has, ok := b.hasCached(bl.Cid()); ok && has {
return nil
}

// See comment in PutMany
err := b.blockstore.Put(bl)
if err == nil {
b.bloom.AddTS(bl.Cid().Bytes())
Expand All @@ -155,7 +152,7 @@ func (b *bloomcache) Put(bl blocks.Block) error {

func (b *bloomcache) PutMany(bs []blocks.Block) error {
// bloom cache gives only conclusive resulty if key is not contained
// to reduce number of puts we need conclusive infomration if block is contained
// to reduce number of puts we need conclusive information if block is contained
// this means that PutMany can't be improved with bloom cache so we just
// just do a passthrough.
err := b.blockstore.PutMany(bs)
Expand Down