mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
lint and review changes
Log an error in the probably-irrelevant case where we ended up with a file, but Stat failed, which shouldn't ever happen we hope anyway. Also explicitly discard the status from RemapRoaringStorage in a case where we don't care.
This commit is contained in:
parent
cb686dcad0
commit
337e451cc7
1 changed files with 4 additions and 1 deletions
|
|
@ -296,6 +296,9 @@ func (f *fragment) applyStorage(data []byte, file *os.File, newGen generation, m
|
|||
if len(data) == 0 {
|
||||
if file != nil {
|
||||
fi, err := file.Stat()
|
||||
if err != nil {
|
||||
f.Logger.Printf("trying to apply new storage to existing bitmap, stat failed: %v", err)
|
||||
}
|
||||
if err == nil && fi != nil && fi.Size() == 0 {
|
||||
return f.emptyStorage(file)
|
||||
}
|
||||
|
|
@ -305,7 +308,7 @@ func (f *fragment) applyStorage(data []byte, file *os.File, newGen generation, m
|
|||
// our containers to use that storage *to take advantage of
|
||||
// mmap*, we'll just make sure our containers aren't pointing to
|
||||
// old storage and say "nope".
|
||||
f.storage.RemapRoaringStorage(nil)
|
||||
_, _ = f.storage.RemapRoaringStorage(nil)
|
||||
f.storage.SetSource(nil)
|
||||
return false, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue