Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9811a14
Returning series ref in ChunkSeriesSet.At()
Jun 11, 2019
12a10a0
newCompactionMerger takes []ChunkSeriesSet. Calculating (old series i…
Jun 11, 2019
b7839c4
User (old series id -> new series id) map to write new postings
Jun 11, 2019
5d3bf62
Get rid of postingMap
Jun 12, 2019
76b67fd
NumSeries() for BlockReader. Pre-allocate memory for seriesMap maps.
Jun 12, 2019
64e4487
Set a higher initial value for postingBuf
Jun 14, 2019
3a4a6e6
Efficiently iterate over all sorted label-values
Jun 14, 2019
0a0dbfe
Hint number of postings writes to the index Writer to pre-allocate me…
Jun 14, 2019
c1c39ed
Pre-allocate slice for label values in populateBlock
Jun 14, 2019
3593059
Re-use bigEndianPostings in populateBlock
Jun 17, 2019
e78ec69
Reuse string buffer when swapping stringTuples
Jun 18, 2019
f344fa2
Reuse byte slice for writing chunk meta hash
Jun 18, 2019
9fab207
Fix race in writeHash
Jun 18, 2019
0ff98c0
Fix lint errors
Jun 18, 2019
407fe55
Reuse slice in ReadOffsetTable. Reduces allocs for OpenBlock.
Jun 18, 2019
39b97e5
Reuse ListPostings in populateBlock.
Jun 18, 2019
4ff0ed8
Check for error before wrapping in blockIndexReader.Series
Jun 18, 2019
387705d
Check for error before wrapping in blockIndexReader.Postings
Jun 18, 2019
cff36d4
Use already allocated byte buffer in writeHash
Jun 18, 2019
f9dfe07
WriteChunks takes a byte buffer to reuse
Jun 18, 2019
e812fba
Breakdown generic writeOffsetTable into writeLabelIndexesOffsetTable …
Jun 19, 2019
b421a4b
Fix review comments
Jun 19, 2019
53ccf99
Reset() for Postings interface
Jun 20, 2019
eb79899
Merge remote-tracking branch 'upstream/master' into compact-opt
Jun 20, 2019
c7af8aa
Fix review comments
Jun 22, 2019
b2b2647
Remove Reset(...) from Postings interface
Jun 28, 2019
b007998
More code comments and fix review comments
Jun 28, 2019
0068b3c
Revert changes to writeOffsetTable
Jul 2, 2019
606fcf1
Revert checking error before wrapping
Jul 2, 2019
0898907
Revert re-use of 'keys' in ReadOffsetTable
Jul 2, 2019
caa715e
Revert changes made to stringTuples
Jul 3, 2019
1d54273
Revert passing byte buffer to WriteChunks and writeHash
Jul 3, 2019
dbec7eb
Merge remote-tracking branch 'upstream/master' into compact-opt
Jul 5, 2019
85bdf35
Merge remote-tracking branch 'upstream/master' into compact-opt
Jul 10, 2019
89d459e
hashEntry -> postingsHashEntry after merging upstream
Jul 10, 2019
f8ddc03
writePostings perf improvements
Jul 10, 2019
1582ebc
Fix review comments
Jul 12, 2019
5993889
Add RemappedPostings
Jul 12, 2019
4293e37
Merge remote-tracking branch 'upstream/master' into compact-opt
Jul 12, 2019
e0693dc
Fix review comments
Jul 15, 2019
048790b
Reset ref in compactionMerger when there are 0 chunks
Jul 16, 2019
605f5b7
compactionMerger doesn't return series with 0 chunks
Jul 23, 2019
40ad33c
Merge remote-tracking branch 'upstream/master' into compact-opt
Jul 23, 2019
b72273f
Fix out-of-order series bug
Jul 24, 2019
ffe544e
Merge remote-tracking branch 'upstream/master' into compact-opt
Jul 24, 2019
570d5e1
Bug fix in compactionMerger.Next()
Jul 24, 2019
4ed0cac
Don't put deleted series in seriesMap
Jul 25, 2019
c252f96
Better allocation strategy for remapped postings
Jul 28, 2019
a75fa32
Faster way to merge remapped postings
Aug 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ type IndexReader interface {
// The Postings here contain the offsets to the series inside the index.
// Found IDs are not strictly required to point to a valid Series, e.g. during
// background garbage collections.
Postings(name, value string) (index.Postings, error)
// 'reusePosts' is the Postings object that can be re-used instead of allocating
// a new object.
Postings(name, value string, reusePosts index.Postings) (index.Postings, error)

// SortedPostings returns a postings list that is reordered to be sorted
// by the label set of the underlying series.
Expand Down Expand Up @@ -448,8 +450,8 @@ func (r blockIndexReader) LabelValues(names ...string) (index.StringTuples, erro
return st, errors.Wrapf(err, "block: %s", r.b.Meta().ULID)
}

func (r blockIndexReader) Postings(name, value string) (index.Postings, error) {
p, err := r.ir.Postings(name, value)
func (r blockIndexReader) Postings(name, value string, reusePosts index.Postings) (index.Postings, error) {
p, err := r.ir.Postings(name, value, reusePosts)
if err != nil {
return p, errors.Wrapf(err, "block: %s", r.b.Meta().ULID)
}
Expand Down
6 changes: 4 additions & 2 deletions cmd/tsdb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/prometheus/tsdb"
"github.com/prometheus/tsdb/chunks"
tsdb_errors "github.com/prometheus/tsdb/errors"
"github.com/prometheus/tsdb/index"
"github.com/prometheus/tsdb/labels"
"gopkg.in/alecthomas/kingpin.v2"
)
Expand Down Expand Up @@ -500,7 +501,8 @@ func analyzeBlock(b tsdb.BlockReader, limit int) error {
labelpairsUncovered := map[string]uint64{}
labelpairsCount := map[string]uint64{}
entries := 0
p, err := ir.Postings("", "") // The special all key.
apkName, apkValue := index.AllPostingsKey()
p, err := ir.Postings(apkName, apkValue, nil) // The special all key.
if err != nil {
return err
}
Expand Down Expand Up @@ -596,7 +598,7 @@ func analyzeBlock(b tsdb.BlockReader, limit int) error {
return err
}
for _, n := range names {
postings, err := ir.Postings("__name__", n)
postings, err := ir.Postings("__name__", n, nil)
if err != nil {
return err
}
Expand Down
Loading