Commit Graph

27 Commits

Author SHA1 Message Date
Anton Kaliaev f0c44d1bd0
[autofile] include call to group#Close in tests 2018-06-06 11:52:59 +04:00
Ethan Buchman a7e049a228 Merge branch 'master' into develop 2018-06-05 21:39:23 -07:00
Anton Kaliaev e0985bf566 flush on stop & function to close group
as opposite to OpenGroup
2018-06-05 17:11:06 -07:00
Jae Kwon a8fcf45624 Change defaults to 100M and 10G respectively 2018-05-10 20:58:28 -07:00
Jae Kwon 2e41756b55 Add logjack command 2018-05-10 20:43:50 -07:00
Thomas Corbière ee67e34519 Fix lint errors (#190)
* use increment and decrement operators.

* remove unnecessary else branches.

* fix receiver names.

* remove omittable code.

* fix dot imports.
2018-04-03 12:23:28 +02:00
Anton Kaliaev d8dd497069
fix metalinter errors 2017-10-30 13:01:18 -05:00
Anton Kaliaev 668698584d
[autofile] test GroupReader more extensively (Refs #69) 2017-10-30 12:48:51 -05:00
Anton Kaliaev 103fee6192
add tests for autofile group Write, reader#Read 2017-10-24 23:20:17 +04:00
Anton Kaliaev 81591e288e
fix metalinter warnings 2017-10-24 23:19:53 +04:00
Anton Kaliaev 21b2c26fb1
GroupReader#Read: return io.EOF if file is empty 2017-10-23 13:02:14 +04:00
Anton Kaliaev c75ddd0fa3
return err if empty slice given 2017-10-23 13:02:02 +04:00
Anton Kaliaev 35e81018e9
add MinIndex method to Group 2017-10-20 13:09:51 +04:00
Anton Kaliaev aace56018a
add Read method to GroupReader 2017-10-20 12:38:45 +04:00
Anton Kaliaev 45095e83e7
add Write method to autofile/Group 2017-10-17 16:48:44 +04:00
Anton Kaliaev 498fb1134a
write docs for autofile/group 2017-10-17 16:48:34 +04:00
Ethan Buchman 7dd6b3d3f8 Merge pull request #53 from tendermint/metalinter
add metalinter to CI and address some lint warnings
2017-10-04 00:21:24 -04:00
Ethan Buchman c8805fd7de metalinter fixes from review 2017-10-04 00:13:58 -04:00
Zach Ramsay cf49ba876f linter: couple fixes 2017-10-03 17:23:14 -04:00
Ethan Buchman 0948343a6f autofile: ensure file is open in Sync 2017-10-02 14:17:16 -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