Skip to content

Commit

Permalink
Revert "Cut 2.18.2 release with query bug fix. (prometheus#7364)" (pr…
Browse files Browse the repository at this point in the history
…ometheus#7367)

This reverts commit 7626115.
  • Loading branch information
bwplotka authored Jun 9, 2020
1 parent 7626115 commit 1a4c97e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
## 2.18.2 / 2020-06-09

* [BUGFIX] TSDB: Fix incorrect query results when using Prometheus with remote reads configured #7361

## 2.18.1 / 2020-05-07

* [BUGFIX] TSDB: Fixed snapshot API. #7217
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.18.2
2.18.1
15 changes: 4 additions & 11 deletions storage/fanout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,10 @@ func TestMergeQuerierWithChainMerger(t *testing.T) {
}
qs = append(qs, tc.extraQueriers...)

mergedQuerier, _, _ := NewMergeQuerier(qs[0], qs, ChainedSeriesMerge).Select(false, nil)

// Get all merged series upfront to make sure there are no incorrectly retained shared
// buffers causing bugs.
var mergedSeries []Series
for mergedQuerier.Next() {
mergedSeries = append(mergedSeries, mergedQuerier.At())
}
testutil.Ok(t, mergedQuerier.Err())

for _, actualSeries := range mergedSeries {
merged, _, _ := NewMergeQuerier(qs[0], qs, ChainedSeriesMerge).Select(false, nil)
for merged.Next() {
testutil.Assert(t, tc.expected.Next(), "Expected Next() to be true")
actualSeries := merged.At()
expectedSeries := tc.expected.At()
testutil.Equals(t, expectedSeries.Labels(), actualSeries.Labels())

Expand All @@ -215,6 +207,7 @@ func TestMergeQuerierWithChainMerger(t *testing.T) {
testutil.Equals(t, expErr, actErr)
testutil.Equals(t, expSmpl, actSmpl)
}
testutil.Ok(t, merged.Err())
testutil.Assert(t, !tc.expected.Next(), "Expected Next() to be false")
})
}
Expand Down
14 changes: 8 additions & 6 deletions storage/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,26 @@ func (q *chunkQuerierAdapter) Select(sortSeries bool, hints *SelectHints, matche

type seriesMergerAdapter struct {
VerticalSeriesMergeFunc
buf []Series
}

func (a *seriesMergerAdapter) Merge(s ...Labels) Labels {
buf := make([]Series, 0, len(s))
a.buf = a.buf[:0]
for _, ser := range s {
buf = append(buf, ser.(Series))
a.buf = append(a.buf, ser.(Series))
}
return a.VerticalSeriesMergeFunc(buf...)
return a.VerticalSeriesMergeFunc(a.buf...)
}

type chunkSeriesMergerAdapter struct {
VerticalChunkSeriesMergerFunc
buf []ChunkSeries
}

func (a *chunkSeriesMergerAdapter) Merge(s ...Labels) Labels {
buf := make([]ChunkSeries, 0, len(s))
a.buf = a.buf[:0]
for _, ser := range s {
buf = append(buf, ser.(ChunkSeries))
a.buf = append(a.buf, ser.(ChunkSeries))
}
return a.VerticalChunkSeriesMergerFunc(buf...)
return a.VerticalChunkSeriesMergerFunc(a.buf...)
}

0 comments on commit 1a4c97e

Please sign in to comment.