Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: memiavl leave tmp directories behind #1099

Merged
merged 12 commits into from
Jul 13, 2023
Prev Previous commit
Next Next commit
propogate error
  • Loading branch information
yihuang committed Jul 12, 2023
commit a0beaa16073deebc1691a9bde0cc80b7beb8b803
5 changes: 1 addition & 4 deletions memiavl/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,7 @@ func (db *DB) RewriteSnapshot() error {
return err
}
if err := db.MultiTree.WriteSnapshot(path); err != nil {
if err := os.RemoveAll(path); err != nil {
db.logger.Error("failed to remove tmp directories", "err", err)
}
return err
return errors.Join(err, os.RemoveAll(path))
}
if err := os.Rename(path, filepath.Join(db.dir, snapshotDir)); err != nil {
return err
Expand Down