diff --git a/CHANGELOG.md b/CHANGELOG.md index 4becd5ce26..28eca096d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ ## master / unreleased - [CHANGE] New `WALSegmentSize` option to override the `DefaultOptions.WALSegmentSize`. Added to allow using smaller wal files. For example using tmpfs on a RPI to minimise the SD card wear out from the constant WAL writes. As part of this change the `DefaultOptions.WALSegmentSize` constant was also exposed. + - [CLEANUP] `Options.WALFlushInterval` is removed as it wasn't used anywhere. ## 0.3.1 -- [BUGFIX] Fixed most windows test and some actual bugs for unclosed file readers. + - [BUGFIX] Fixed most windows test and some actual bugs for unclosed file readers. ## 0.3.0 - [CHANGE] `LastCheckpoint()` used to return just the segment name and now it returns the full relative path. diff --git a/cmd/tsdb/main.go b/cmd/tsdb/main.go index 8f1cf8d43e..c5fac9cd8e 100644 --- a/cmd/tsdb/main.go +++ b/cmd/tsdb/main.go @@ -130,7 +130,6 @@ func (b *writeBenchmark) run() { l = log.With(l, "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller) st, err := tsdb.Open(dir, l, nil, &tsdb.Options{ - WALFlushInterval: 200 * time.Millisecond, RetentionDuration: 15 * 24 * 60 * 60 * 1000, // 15 days in milliseconds BlockRanges: tsdb.ExponentialBlockRanges(2*60*60*1000, 5, 3), }) diff --git a/db.go b/db.go index e5a057cbae..43cfadd46a 100644 --- a/db.go +++ b/db.go @@ -44,7 +44,6 @@ import ( // DefaultOptions used for the DB. They are sane for setups using // millisecond precision timestamps. var DefaultOptions = &Options{ - WALFlushInterval: 5 * time.Second, WALSegmentSize: wal.DefaultSegmentSize, RetentionDuration: 15 * 24 * 60 * 60 * 1000, // 15 days in milliseconds BlockRanges: ExponentialBlockRanges(int64(2*time.Hour)/1e6, 3, 5), @@ -53,9 +52,6 @@ var DefaultOptions = &Options{ // Options of the DB storage. type Options struct { - // The interval at which the write ahead log is flushed to disk. - WALFlushInterval time.Duration - // Segments (wal files) max size WALSegmentSize int diff --git a/wal.go b/wal.go index 684a2fa6a9..f65c7a3a44 100644 --- a/wal.go +++ b/wal.go @@ -94,27 +94,6 @@ type WAL interface { Close() error } -// NopWAL is a WAL that does nothing. -func NopWAL() WAL { - return nopWAL{} -} - -type nopWAL struct{} - -func (nopWAL) Read( - seriesf func([]RefSeries), - samplesf func([]RefSample), - deletesf func([]Stone), -) error { - return nil -} -func (w nopWAL) Reader() WALReader { return w } -func (nopWAL) LogSeries([]RefSeries) error { return nil } -func (nopWAL) LogSamples([]RefSample) error { return nil } -func (nopWAL) LogDeletes([]Stone) error { return nil } -func (nopWAL) Truncate(int64, func(uint64) bool) error { return nil } -func (nopWAL) Close() error { return nil } - // WALReader reads entries from a WAL. type WALReader interface { Read(