mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-11 23:31:03 +00:00
when updating a container, drop the single-container cache
This can cause incredibly weird and hard-to-debug problems if the previous container value is still in the cache after an update, and in particular, can result in having a stale container value cached after a roaring import that modified the container. Coupled with another bug which could corrupt containers on a delete, this produces a very strange bug where a value is present in a fragment, but an attempt to delete it reports failure.
This commit is contained in:
parent
c5e9b8d917
commit
16ba54293a
2 changed files with 3 additions and 0 deletions
|
|
@ -189,6 +189,8 @@ func (btc *bTreeContainers) Repair() {
|
|||
// replace the given container.
|
||||
func (btc *bTreeContainers) Update(key uint64, fn func(*Container, bool) (*Container, bool)) {
|
||||
btc.tree.Put(key, fn)
|
||||
btc.lastKey = ^uint64(0)
|
||||
btc.lastContainer = nil
|
||||
}
|
||||
|
||||
// UpdateEvery calls fn (existing-container, existed), and expects
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ func (sc *sliceContainers) Update(key uint64, fn func(*Container, bool) (*Contai
|
|||
sc.insertAt(key, nc, i)
|
||||
}
|
||||
}
|
||||
sc.invalidateCache()
|
||||
}
|
||||
|
||||
// UpdateEvery calls fn (existing-container, existed), and expects
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue