mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
wal: better log msg
This commit is contained in:
parent
53792ccbdc
commit
89242d4659
@ -73,7 +73,7 @@ func checkWalNames(names []string) []string {
|
|||||||
wnames := make([]string, 0)
|
wnames := make([]string, 0)
|
||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
if _, _, err := parseWalName(name); err != nil {
|
if _, _, err := parseWalName(name); err != nil {
|
||||||
log.Printf("wal: parse %s error: %v", name, err)
|
log.Printf("wal: ignored file %v in wal", name)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
wnames = append(wnames, name)
|
wnames = append(wnames, name)
|
||||||
|
@ -298,8 +298,8 @@ func (w *WAL) cut() error {
|
|||||||
fpath := path.Join(w.dir, walName(w.seq+1, w.enti+1))
|
fpath := path.Join(w.dir, walName(w.seq+1, w.enti+1))
|
||||||
ftpath := fpath + ".tmp"
|
ftpath := fpath + ".tmp"
|
||||||
|
|
||||||
// create a temp wal file with name sequence + 1
|
// create a temp wal file with name sequence + 1, or tuncate the existing one
|
||||||
ft, err := os.OpenFile(ftpath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0600)
|
ft, err := os.OpenFile(ftpath, os.O_WRONLY|os.O_APPEND|os.O_CREATE|os.O_TRUNC, 0600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user