Skip to content

Commit acd4a8a

Browse files
pstibranycodesome
andauthored
Remove old chunk mapper. (#311)
* Remove old chunk mapper. Signed-off-by: Peter Štibraný <pstibrany@gmail.com> * Revert to code from upstream. Signed-off-by: Peter Štibraný <pstibrany@gmail.com> * Fix OOO test failures Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com> * Fix sorting in TestOOOHeadChunkReader_LabelValues Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com> Signed-off-by: Peter Štibraný <pstibrany@gmail.com> Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com> Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
1 parent e945601 commit acd4a8a

8 files changed

Lines changed: 37 additions & 1240 deletions

File tree

tsdb/chunks/head_chunks_test.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func TestChunkDiskMapper_WriteUnsupportedChunk_Chunk_IterateChunks(t *testing.T)
176176
require.NoError(t, hrw.Close())
177177
}()
178178

179-
ucSeriesRef, ucChkRef, ucMint, ucMaxt, uchunk := writeUnsupportedChunk(t, 0, hrw, nil)
179+
ucSeriesRef, ucChkRef, ucMint, ucMaxt, uchunk := writeUnsupportedChunk(t, 0, hrw)
180180

181181
// Checking on-disk bytes for the first file.
182182
require.Equal(t, 1, len(hrw.mmappedChunkFiles), "expected 1 mmapped file, got %d", len(hrw.mmappedChunkFiles))
@@ -554,24 +554,17 @@ func createChunk(t *testing.T, idx int, hrw *ChunkDiskMapper) (seriesRef HeadSer
554554
return
555555
}
556556

557-
func writeUnsupportedChunk(t *testing.T, idx int, hrw *ChunkDiskMapper, hrwOld *OldChunkDiskMapper) (seriesRef HeadSeriesRef, chunkRef ChunkDiskMapperRef, mint, maxt int64, chunk chunkenc.Chunk) {
557+
func writeUnsupportedChunk(t *testing.T, idx int, hrw *ChunkDiskMapper) (seriesRef HeadSeriesRef, chunkRef ChunkDiskMapperRef, mint, maxt int64, chunk chunkenc.Chunk) {
558558
var err error
559559
seriesRef = HeadSeriesRef(rand.Int63())
560560
mint = int64((idx)*1000 + 1)
561561
maxt = int64((idx + 1) * 1000)
562562
chunk = randomUnsupportedChunk(t)
563563
awaitCb := make(chan struct{})
564-
if hrw != nil {
565-
chunkRef = hrw.WriteChunk(seriesRef, mint, maxt, chunk, func(cbErr error) {
566-
require.NoError(t, err)
567-
close(awaitCb)
568-
})
569-
} else {
570-
chunkRef = hrwOld.WriteChunk(seriesRef, mint, maxt, chunk, func(cbErr error) {
571-
require.NoError(t, err)
572-
})
564+
chunkRef = hrw.WriteChunk(seriesRef, mint, maxt, chunk, func(cbErr error) {
565+
require.NoError(t, err)
573566
close(awaitCb)
574-
}
567+
})
575568
<-awaitCb
576569
return
577570
}

0 commit comments

Comments
 (0)