mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-09 22:51:02 +00:00
Merge pull request #1990 from seebs/renameSemantics
use os.Rename semantically correctly
This commit is contained in:
commit
aa5c5a3afa
1 changed files with 2 additions and 3 deletions
5
view.go
5
view.go
|
|
@ -437,12 +437,11 @@ func upgradeViewBSIv2(v *view, bitDepth uint) (ok bool, _ error) {
|
|||
}
|
||||
ok = true // mark as upgraded, requires reload
|
||||
|
||||
oldPath := frag.path
|
||||
if newPath, err := upgradeRoaringBSIv2(frag, bitDepth); err != nil {
|
||||
if tmpPath, err := upgradeRoaringBSIv2(frag, bitDepth); err != nil {
|
||||
return ok, errors.Wrap(err, "upgrading bsi v2")
|
||||
} else if err := frag.closeStorage(); err != nil {
|
||||
return ok, errors.Wrap(err, "closing after bsi v2 upgrade")
|
||||
} else if err := os.Rename(oldPath, newPath); err != nil {
|
||||
} else if err := os.Rename(tmpPath, frag.path); err != nil {
|
||||
return ok, errors.Wrap(err, "renaming after bsi v2 upgrade")
|
||||
} else if err := frag.openStorage(); err != nil {
|
||||
return ok, errors.Wrap(err, "re-opening after bsi v2 upgrade")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue