Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Ganesh Vernekar <[email protected]>
  • Loading branch information
codesome committed Jun 8, 2023
1 parent 8488231 commit e2d189a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 2 additions & 3 deletions pkg/querier/block_streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (bqss *blockStreamingQuerierSeriesSet) Next() bool {
}

currLabels := mimirpb.FromLabelAdaptersToLabels(bqss.series[bqss.next].Labels)
seriesIdxStart, seriesIdxEnd := bqss.next, bqss.next
seriesIdxStart := bqss.next
bqss.next++

// Merge chunks for current series. Chunks may come in multiple responses, but as soon
Expand All @@ -43,9 +43,8 @@ func (bqss *blockStreamingQuerierSeriesSet) Next() bool {
for bqss.next < len(bqss.series) && labels.Compare(currLabels, mimirpb.FromLabelAdaptersToLabels(bqss.series[bqss.next].Labels)) == 0 {
bqss.next++
}
seriesIdxEnd = bqss.next - 1

bqss.currSeries = newBlockStreamingQuerierSeries(currLabels, seriesIdxStart, seriesIdxEnd, bqss.streamReader)
bqss.currSeries = newBlockStreamingQuerierSeries(currLabels, seriesIdxStart, bqss.next-1, bqss.streamReader)
return true
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/storegateway/bucket_chunk_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestBucketChunkReader_refetchChunks(t *testing.T) {

newTestBucketBlock := prepareTestBlock(test.NewTB(t), appendTestSeries(1000))
block := newTestBucketBlock()
seriesRefsIterator, err := openBlockSeriesChunkRefsSetsIterator(
seriesRefsIterator, _, _, err := openBlockSeriesChunkRefsSetsIterator(
ctx,
5000,
"tenant-1",
Expand All @@ -43,6 +43,7 @@ func TestBucketChunkReader_refetchChunks(t *testing.T) {
block.meta.MaxTime,
2,
newSafeQueryStats(),
nil, nil,
log.NewNopLogger(),
)
require.NoError(t, err)
Expand Down
15 changes: 10 additions & 5 deletions pkg/storegateway/series_refs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ func TestOpenBlockSeriesChunkRefsSetsIterator(t *testing.T) {
maxT = testCase.maxT
}

iterator, err := openBlockSeriesChunkRefsSetsIterator(
iterator, _, _, err := openBlockSeriesChunkRefsSetsIterator(
ctx,
testCase.batchSize,
"",
Expand All @@ -1677,6 +1677,7 @@ func TestOpenBlockSeriesChunkRefsSetsIterator(t *testing.T) {
maxT,
2,
newSafeQueryStats(),
nil, nil,
nil,
)
require.NoError(t, err)
Expand Down Expand Up @@ -1763,7 +1764,7 @@ func TestOpenBlockSeriesChunkRefsSetsIterator_pendingMatchers(t *testing.T) {
block.pendingReaders.Add(2) // this is hacky, but can be replaced only block.indexReade() accepts a strategy
querySeries := func(indexReader *bucketIndexReader) []seriesChunkRefsSet {
hashCache := hashcache.NewSeriesHashCache(1024 * 1024).GetBlockCache(block.meta.ULID.String())
iterator, err := openBlockSeriesChunkRefsSetsIterator(
iterator, _, _, err := openBlockSeriesChunkRefsSetsIterator(
ctx,
testCase.batchSize,
"",
Expand All @@ -1778,6 +1779,7 @@ func TestOpenBlockSeriesChunkRefsSetsIterator_pendingMatchers(t *testing.T) {
block.meta.MaxTime,
2,
newSafeQueryStats(),
nil, nil,
nil,
)
require.NoError(t, err)
Expand Down Expand Up @@ -1826,7 +1828,7 @@ func BenchmarkOpenBlockSeriesChunkRefsSetsIterator(b *testing.B) {
b.ResetTimer()

for i := 0; i < b.N; i++ {
iterator, err := openBlockSeriesChunkRefsSetsIterator(
iterator, _, _, err := openBlockSeriesChunkRefsSetsIterator(
ctx,
5000,
"",
Expand All @@ -1841,6 +1843,7 @@ func BenchmarkOpenBlockSeriesChunkRefsSetsIterator(b *testing.B) {
block.meta.MaxTime,
2,
newSafeQueryStats(),
nil, nil,
nil,
)
require.NoError(b, err)
Expand Down Expand Up @@ -2374,7 +2377,7 @@ func TestOpenBlockSeriesChunkRefsSetsIterator_SeriesCaching(t *testing.T) {
// All test cases have a single matcher, so the strategy wouldn't really make a difference.
// Pending matchers are tested in other tests.
indexReader := b.indexReader(selectAllStrategy{})
ss, err := openBlockSeriesChunkRefsSetsIterator(
ss, _, _, err := openBlockSeriesChunkRefsSetsIterator(
context.Background(),
batchSize,
"",
Expand All @@ -2389,6 +2392,7 @@ func TestOpenBlockSeriesChunkRefsSetsIterator_SeriesCaching(t *testing.T) {
b.meta.MaxTime,
1,
statsColdCache,
nil, nil,
log.NewNopLogger(),
)

Expand All @@ -2405,7 +2409,7 @@ func TestOpenBlockSeriesChunkRefsSetsIterator_SeriesCaching(t *testing.T) {
}

statsWarnCache := newSafeQueryStats()
ss, err = openBlockSeriesChunkRefsSetsIterator(
ss, _, _, err = openBlockSeriesChunkRefsSetsIterator(
context.Background(),
batchSize,
"",
Expand All @@ -2420,6 +2424,7 @@ func TestOpenBlockSeriesChunkRefsSetsIterator_SeriesCaching(t *testing.T) {
b.meta.MaxTime,
1,
statsWarnCache,
nil, nil,
log.NewNopLogger(),
)
require.NoError(t, err)
Expand Down

0 comments on commit e2d189a

Please sign in to comment.