mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
mvcc/backend: remove db.tmp regardless of logger presence
This commit is contained in:
parent
84ace97ad7
commit
7e0e6bf497
@ -240,11 +240,9 @@ func checkSuffix(lg *zap.Logger, names []string) []string {
|
|||||||
func (s *Snapshotter) cleanupSnapdir(filenames []string) error {
|
func (s *Snapshotter) cleanupSnapdir(filenames []string) error {
|
||||||
for _, filename := range filenames {
|
for _, filename := range filenames {
|
||||||
if strings.HasPrefix(filename, "db.tmp") {
|
if strings.HasPrefix(filename, "db.tmp") {
|
||||||
if s.lg != nil {
|
s.lg.Info("found orphaned defragmentation file; deleting", zap.String("path", filename))
|
||||||
s.lg.Info("found orphaned defragmentation file; deleting", zap.String("path", filename))
|
if rmErr := os.Remove(filepath.Join(s.dir, filename)); rmErr != nil && !os.IsNotExist(rmErr) {
|
||||||
if rmErr := os.Remove(filepath.Join(s.dir, filename)); rmErr != nil && !os.IsNotExist(rmErr) {
|
return fmt.Errorf("failed to remove orphaned defragmentation file %s: %v", filename, rmErr)
|
||||||
return fmt.Errorf("failed to remove orphaned defragmentation file %s: %v", filename, rmErr)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user