wal.go (etcd-3.5.5) | : | wal.go (etcd-3.5.6) | ||
---|---|---|---|---|
skipping to change at line 118 | skipping to change at line 118 | |||
// keep temporary wal directory so WAL initialization appears atomic | // keep temporary wal directory so WAL initialization appears atomic | |||
tmpdirpath := filepath.Clean(dirpath) + ".tmp" | tmpdirpath := filepath.Clean(dirpath) + ".tmp" | |||
if fileutil.Exist(tmpdirpath) { | if fileutil.Exist(tmpdirpath) { | |||
if err := os.RemoveAll(tmpdirpath); err != nil { | if err := os.RemoveAll(tmpdirpath); err != nil { | |||
return nil, err | return nil, err | |||
} | } | |||
} | } | |||
defer os.RemoveAll(tmpdirpath) | defer os.RemoveAll(tmpdirpath) | |||
if err := fileutil.CreateDirAll(tmpdirpath); err != nil { | if err := fileutil.CreateDirAll(lg, tmpdirpath); err != nil { | |||
lg.Warn( | lg.Warn( | |||
"failed to create a temporary WAL directory", | "failed to create a temporary WAL directory", | |||
zap.String("tmp-dir-path", tmpdirpath), | zap.String("tmp-dir-path", tmpdirpath), | |||
zap.String("dir-path", dirpath), | zap.String("dir-path", dirpath), | |||
zap.Error(err), | zap.Error(err), | |||
) | ) | |||
return nil, err | return nil, err | |||
} | } | |||
p := filepath.Join(tmpdirpath, walName(0, 0)) | p := filepath.Join(tmpdirpath, walName(0, 0)) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |