mvcc: log error if tmpdb is not removed (#11523)
Co-authored-by: yutedz <54038175+yutedz@users.noreply.github.com>release-3.5
parent
e5a35c827c
commit
8aa7a3dc09
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue