wal: fsync directory after wal file rename

Fixes #6368
This commit is contained in:
Anthony Romano
2016-09-07 16:40:33 -07:00
parent c449da6ff9
commit bd7107bd4b
2 changed files with 52 additions and 10 deletions

View File

@ -16,7 +16,11 @@
package wal
import "os"
import (
"os"
"github.com/coreos/etcd/pkg/fileutil"
)
func (w *WAL) renameWal(tmpdirpath string) (*WAL, error) {
// On non-Windows platforms, hold the lock while renaming. Releasing
@ -34,5 +38,7 @@ func (w *WAL) renameWal(tmpdirpath string) (*WAL, error) {
}
w.fp = newFilePipeline(w.dir, SegmentSizeBytes)
return w, nil
df, err := fileutil.OpenDir(w.dir)
w.dirFile = df
return w, err
}