Merge pull request #3372 from prometheus/maxblockdur

tsdb: default too small max block duration
This commit is contained in:
Fabian Reinartz 2017-10-31 12:22:56 +01:00 committed by GitHub
commit eef46ae8e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -127,8 +127,7 @@ type Options struct {
// Open returns a new storage backed by a TSDB database that is configured for Prometheus.
func Open(path string, l log.Logger, r prometheus.Registerer, opts *Options) (*tsdb.DB, error) {
if opts.MinBlockDuration > opts.MaxBlockDuration {
return nil, errors.Errorf("tsdb max block duration (%v) must be larger than min block duration (%v)",
opts.MaxBlockDuration, opts.MinBlockDuration)
opts.MaxBlockDuration = opts.MinBlockDuration
}
// Start with smallest block duration and create exponential buckets until the exceed the
// configured maximum block duration.