mvcc: log error if tmpdb is not removed (#11523)

Co-authored-by: yutedz <54038175+yutedz@users.noreply.github.com>
release-3.5
Ted Yu 2020-01-16 17:34:45 -08:00 committed by Xiang Li
parent e5a35c827c
commit 8aa7a3dc09
1 changed files with 7 additions and 1 deletions

View File

@ -391,7 +391,13 @@ func (b *backend) defrag() error {
err = defragdb(b.db, tmpdb, defragLimit)
if err != nil {
tmpdb.Close()
os.RemoveAll(tmpdb.Path())
if rmErr := os.RemoveAll(tmpdb.Path()); rmErr != nil {
if b.lg != nil {
b.lg.Error("failed to remove dirs under tmpdb", zap.Error(rmErr))
} else {
plog.Errorf("failed to remove dirs under tmpdb (%s)", rmErr)
}
}
return err
}