mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-01 16:11:11 -08:00
check return status of cutnewfile
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
This commit is contained in:
parent
3fa636a799
commit
2eef3e76b8
|
@ -489,7 +489,6 @@ func (cdm *ChunkDiskMapper) CutNewFile() error {
|
|||
defer cdm.evtlPosMtx.Unlock()
|
||||
|
||||
cdm.evtlPos.cutFileOnNextChunk()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -801,7 +800,6 @@ func (cdm *ChunkDiskMapper) IterateAllChunks(f func(seriesRef HeadSeriesRef, chu
|
|||
if seriesRef == 0 && mint == 0 && maxt == 0 {
|
||||
break
|
||||
}
|
||||
|
||||
// Encoding.
|
||||
chkEnc := chunkenc.Encoding(mmapFile.byteSlice.Range(idx, idx+ChunkEncodingSize)[0])
|
||||
idx += ChunkEncodingSize
|
||||
|
|
|
@ -116,7 +116,7 @@ func TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks(t *testing.T) {
|
|||
}
|
||||
}
|
||||
addChunks(100)
|
||||
hrw.CutNewFile()
|
||||
require.NoError(t, hrw.CutNewFile())
|
||||
addChunks(10) // For chunks in in-memory buffer.
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ func TestChunkDiskMapper_Truncate(t *testing.T) {
|
|||
|
||||
// Create segments 1 to 7.
|
||||
for i := 1; i <= 7; i++ {
|
||||
hrw.CutNewFile()
|
||||
require.NoError(t, hrw.CutNewFile())
|
||||
mint := int64(addChunk())
|
||||
if i == 3 {
|
||||
thirdFileMinT = mint
|
||||
|
@ -453,7 +453,7 @@ func TestHeadReadWriter_ReadRepairOnEmptyLastFile(t *testing.T) {
|
|||
nonEmptyFile := func() {
|
||||
t.Helper()
|
||||
|
||||
hrw.CutNewFile()
|
||||
require.NoError(t, hrw.CutNewFile())
|
||||
addChunk()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue