From ab8476dd061f730809d7a06201861986e0a46fe8 Mon Sep 17 00:00:00 2001 From: Krasi Georgiev Date: Sat, 2 Mar 2019 15:54:49 +0200 Subject: [PATCH] Release 0.6.0 (#537) --- CHANGELOG.md | 3 +++ db.go | 16 ++++++++-------- db_test.go | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eb8f48c2..534de25cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## master / unreleased +## 0.6.0 + - [CHANGE] `AllowOverlappingBlock` is now `AllowOverlappingBlocks`. + ## 0.5.0 - [FEATURE] Time-ovelapping blocks are now allowed. [#370](https://github.com/prometheus/tsdb/pull/370) - Disabled by default and can be enabled via `AllowOverlappingBlock` option. diff --git a/db.go b/db.go index 32599c551..7b03a209c 100644 --- a/db.go +++ b/db.go @@ -45,11 +45,11 @@ import ( // DefaultOptions used for the DB. They are sane for setups using // millisecond precision timestamps. var DefaultOptions = &Options{ - WALSegmentSize: wal.DefaultSegmentSize, - RetentionDuration: 15 * 24 * 60 * 60 * 1000, // 15 days in milliseconds - BlockRanges: ExponentialBlockRanges(int64(2*time.Hour)/1e6, 3, 5), - NoLockfile: false, - AllowOverlappingBlock: false, + WALSegmentSize: wal.DefaultSegmentSize, + RetentionDuration: 15 * 24 * 60 * 60 * 1000, // 15 days in milliseconds + BlockRanges: ExponentialBlockRanges(int64(2*time.Hour)/1e6, 3, 5), + NoLockfile: false, + AllowOverlappingBlocks: false, } // Options of the DB storage. @@ -73,9 +73,9 @@ type Options struct { // NoLockfile disables creation and consideration of a lock file. NoLockfile bool - // Overlapping blocks are allowed iff AllowOverlappingBlock is true. + // Overlapping blocks are allowed if AllowOverlappingBlocks is true. // This in-turn enables vertical compaction and vertical query merge. - AllowOverlappingBlock bool + AllowOverlappingBlocks bool } // Appender allows appending a batch of data. It must be completed with a @@ -553,7 +553,7 @@ func (db *DB) reload() (err error) { sort.Slice(loadable, func(i, j int) bool { return loadable[i].Meta().MinTime < loadable[j].Meta().MinTime }) - if !db.opts.AllowOverlappingBlock { + if !db.opts.AllowOverlappingBlocks { if err := validateBlockSequence(loadable); err != nil { return errors.Wrap(err, "invalid block sequence") } diff --git a/db_test.go b/db_test.go index c910aa2fa..eda807f3f 100644 --- a/db_test.go +++ b/db_test.go @@ -1933,7 +1933,7 @@ func TestVerticalCompaction(t *testing.T) { createBlock(t, tmpdir, series) } opts := *DefaultOptions - opts.AllowOverlappingBlock = true + opts.AllowOverlappingBlocks = true db, err := Open(tmpdir, nil, nil, &opts) testutil.Ok(t, err) defer func() {