diff --git a/vendor/github.com/prometheus/tsdb/compact.go b/vendor/github.com/prometheus/tsdb/compact.go index 3668f0831..0c42bda62 100644 --- a/vendor/github.com/prometheus/tsdb/compact.go +++ b/vendor/github.com/prometheus/tsdb/compact.go @@ -151,16 +151,11 @@ func (c *LeveledCompactor) Plan(dir string) ([]string, error) { if err != nil { return nil, err } - // We do not include the most recently created block. This gives users a window - // of a full block size to piece-wise backup new data without having to care - // about data overlap. if len(dirs) < 1 { return nil, nil } - dirs = dirs[:len(dirs)-1] var dms []dirMeta - for _, dir := range dirs { meta, err := readMetaFile(dir) if err != nil { @@ -176,6 +171,10 @@ func (c *LeveledCompactor) plan(dms []dirMeta) ([]string, error) { return dms[i].meta.MinTime < dms[j].meta.MinTime }) + // We do not include a recently created block with max(minTime), so the block which was just created from WAL. + // This gives users a window of a full block size to piece-wise backup new data without having to care about data overlap. + dms = dms[:len(dms)-1] + var res []string for _, dm := range c.selectDirs(dms) { res = append(res, dm.dir) diff --git a/vendor/github.com/prometheus/tsdb/index/index.go b/vendor/github.com/prometheus/tsdb/index/index.go index 2689b5691..3cad716c0 100644 --- a/vendor/github.com/prometheus/tsdb/index/index.go +++ b/vendor/github.com/prometheus/tsdb/index/index.go @@ -653,6 +653,11 @@ func newReader(b ByteSlice, c io.Closer) (*Reader, error) { return r, nil } +// Version returns the file format version of the underlying index. +func (r *Reader) Version() int { + return r.version +} + // Range marks a byte range. type Range struct { Start, End int64 diff --git a/vendor/vendor.json b/vendor/vendor.json index 14fa760dc..d756ff6a9 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -800,40 +800,40 @@ "revisionTime": "2016-04-11T19:08:41Z" }, { - "checksumSHA1": "zVgXlbZ1J8GhBN7tZji7M/SuiAU=", + "checksumSHA1": "JfxP001vgt0P+hEDk/if0bxa8xU=", "path": "github.com/prometheus/tsdb", - "revision": "16b2bf1b45ce3e3536c78ebec5116ea09a69786e", - "revisionTime": "2018-03-02T11:51:49Z" + "revision": "00404ae5ab578bb550377a17aab5511deb0592c5", + "revisionTime": "2018-03-13T20:20:03Z" }, { "checksumSHA1": "S7F4yWxVLhxQNHMdgoOo6plmOOs=", "path": "github.com/prometheus/tsdb/chunkenc", - "revision": "494acd307058387ced7646f9996b0f7372eaa558", - "revisionTime": "2018-02-15T11:29:47Z" + "revision": "00404ae5ab578bb550377a17aab5511deb0592c5", + "revisionTime": "2018-03-13T20:20:03Z" }, { "checksumSHA1": "+zsn1i8cqwgZXL8Bg6jDy32xjAo=", "path": "github.com/prometheus/tsdb/chunks", - "revision": "494acd307058387ced7646f9996b0f7372eaa558", - "revisionTime": "2018-02-15T11:29:47Z" + "revision": "00404ae5ab578bb550377a17aab5511deb0592c5", + "revisionTime": "2018-03-13T20:20:03Z" }, { "checksumSHA1": "h49AAcJ5+iRBwCgbfQf+2T1E1ZE=", "path": "github.com/prometheus/tsdb/fileutil", - "revision": "494acd307058387ced7646f9996b0f7372eaa558", - "revisionTime": "2018-02-15T11:29:47Z" + "revision": "00404ae5ab578bb550377a17aab5511deb0592c5", + "revisionTime": "2018-03-13T20:20:03Z" }, { - "checksumSHA1": "UlvN+ZhTu52S8f9niySQpPC+dvQ=", + "checksumSHA1": "4ebzIE2Jvj6+SG6yGFSXN8scgfo=", "path": "github.com/prometheus/tsdb/index", - "revision": "494acd307058387ced7646f9996b0f7372eaa558", - "revisionTime": "2018-02-15T11:29:47Z" + "revision": "00404ae5ab578bb550377a17aab5511deb0592c5", + "revisionTime": "2018-03-13T20:20:03Z" }, { "checksumSHA1": "Va8HWvOFTwFeewZFadMAOzNGDps=", "path": "github.com/prometheus/tsdb/labels", - "revision": "494acd307058387ced7646f9996b0f7372eaa558", - "revisionTime": "2018-02-15T11:29:47Z" + "revision": "00404ae5ab578bb550377a17aab5511deb0592c5", + "revisionTime": "2018-03-13T20:20:03Z" }, { "checksumSHA1": "5SYLEhADhdBVZAGPVHWggQl7H8k=",