Describe the bug
Sometimes a simple badger.Open() with default options returns error z.NewFile.
To Reproduce
Keep writing data, closing, reopening, writing data, etc...
A second look gave me the way to reproduce it:
- Just leave the dir state containing
.mem files.
In this case, badger.Open() always return z.NewFile.
Expected behavior
No error. In fact, a second call to badger.Open() returns no error.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
- OS: macOS, Linux
- Language: Go
- Version: v4.7.0
Additional context
This portion of code here seems to be the root cause. So openMemTable can return mt, z.NewFile as per ref. But mt != nil in this case.
Other portions of the code make sense of it, like here.
Describe the bug
Sometimes a simple
badger.Open()with default options returns errorz.NewFile.To Reproduce
Keep writing data, closing, reopening, writing data, etc...
A second look gave me the way to reproduce it:
.memfiles.In this case,
badger.Open()always returnz.NewFile.Expected behavior
No error. In fact, a second call to
badger.Open()returns no error.Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Additional context
This portion of code here seems to be the root cause. So
openMemTablecan returnmt, z.NewFileas per ref. Butmt!= nil in this case.Other portions of the code make sense of it, like here.