Commit Graph

8 Commits

Author SHA1 Message Date
Zach Ramsay cf49ba876f linter: couple fixes 2017-10-03 17:23:14 -04:00
Zach Ramsay 3c57c24921 linting: next round of fixes 2017-09-22 12:14:27 -04:00
Zach Ramsay d6e03d2368 linting: add to Makefile & do some fixes 2017-09-22 11:42:29 -04:00
Anton Kaliaev d71d1394ec
call fsync after flush (Refs #573)
short: flushing the bufio buffer is not enough to ensure data
consistency.

long:
Saving an entry to the WAL calls writeLine to append data to the
autofile group backing the WAL, then calls group.Flush() to flush that
data to persistent storage. group.Flush() in turn proxies to
headBuf.flush(), flushing the active bufio.BufferedWriter. However,
BufferedWriter wraps a Writer, not another BufferedWriter, and the way
it flushes is by calling io.Writer.Write() to clear the BufferedWriter's
buffer. The io.Writer we're wrapping here is AutoFile, whose Write
method calls os.File.Write(), performing an unbuffered write to the
operating system, where, I assume, it sits in the OS buffers awaiting
sync. This means that Wal.Save does not, in fact, ensure the saved
operation is synced to disk before returning.
2017-09-21 16:11:28 -07:00
Anton Kaliaev 74a7f8c92b
[autofile] close file before renaming it
this might fix our windows bug https://github.com/tendermint/tendermint/issues/444

0980f8e197
2017-05-15 10:47:16 +02:00
Ethan Buchman 2f8551d3b6 go-common -> tmlibs 2017-04-18 17:56:05 -04:00
Ethan Buchman 900be74e8f update import paths 2017-04-18 16:33:51 -04:00
Ethan Buchman a893bb119b merge go-autofile 2017-04-18 16:33:26 -04:00