mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-09 06:31:02 +00:00
don't close storage after failing to open cache
If the inner function that handles the open of storage and cache fails, we close the fragment. If we closeStorage() before that, then we can try to close the storage again, which causes a panic when we try to mark the generation as Done again. I was going to set f.gen = nil after marking it done, but I'm not feeling safe about that -- there's too many places where we check things about f.gen, and it seems unsafe. The generation code should be removed at some point, because it all exists as a workaround for not having any way to detect when reads are "done", because we didn't want to do something huge and intrusive, like adding the Tx system and requiring transactions to get closed.
This commit is contained in:
parent
8ed922d30e
commit
8433f81b68
1 changed files with 0 additions and 4 deletions
|
|
@ -286,10 +286,6 @@ func (f *fragment) Open() error {
|
|||
// Fill cache with rows persisted to disk.
|
||||
f.holder.Logger.Debugf("open cache for index/field/view/fragment: %s/%s/%s/%d", f.index(), f.field(), f.view(), f.shard)
|
||||
if err := f.openCache(); err != nil {
|
||||
e2 := f.closeStorage()
|
||||
if e2 != nil {
|
||||
return errors.Wrapf(err, "closing storage: %v, after opening cache", e2)
|
||||
}
|
||||
return errors.Wrap(err, "opening cache")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue