Skip to content

Commit

Permalink
Merge pull request #12751 from cwedgwood/nofsyncdowrite
Browse files Browse the repository at this point in the history
When using --unsafe-no-fsync still write out the data
  • Loading branch information
ptabor authored Mar 7, 2021
2 parents afd6d8a + 94634fc commit 2702f9e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,14 +789,16 @@ func (w *WAL) cut() error {
}

func (w *WAL) sync() error {
if w.unsafeNoSync {
return nil
}
if w.encoder != nil {
if err := w.encoder.flush(); err != nil {
return err
}
}

if w.unsafeNoSync {
return nil
}

start := time.Now()
err := fileutil.Fdatasync(w.tail().File)

Expand Down

0 comments on commit 2702f9e

Please sign in to comment.