Skip to content

Commit

Permalink
Let's not delete values from boom filter
Browse files Browse the repository at this point in the history
  • Loading branch information
deniszh committed Jun 25, 2024
1 parent c9ef183 commit d4e1c11
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,6 @@ func (c *Cache) Pop(key string) (p *points.Points, exists bool) {
delete(shard.items, key)
shard.Unlock()

// we probably can skip that, but I'm a bit worry
// of effectiveness of bloom filter over time
if c.newMetricsChan != nil && c.newMetricCf != nil {
c.newMetricCf.Delete([]byte(p.Metric))
}

if exists {
atomic.AddInt32(&c.stat.size, -int32(len(p.Data)))
}
Expand All @@ -383,12 +377,6 @@ func (c *Cache) PopNotConfirmed(key string) (p *points.Points, exists bool) {
}
shard.Unlock()

// we probably can skip that, but I'm a bit worry
// of effectiveness of bloom filter over time
if c.newMetricsChan != nil && c.newMetricCf != nil {
c.newMetricCf.Delete([]byte(p.Metric))
}

if exists {
atomic.AddInt32(&c.stat.size, -int32(len(p.Data)))
}
Expand Down

0 comments on commit d4e1c11

Please sign in to comment.