mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31: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()
|
defer cdm.evtlPosMtx.Unlock()
|
||||||
|
|
||||||
cdm.evtlPos.cutFileOnNextChunk()
|
cdm.evtlPos.cutFileOnNextChunk()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,7 +800,6 @@ func (cdm *ChunkDiskMapper) IterateAllChunks(f func(seriesRef HeadSeriesRef, chu
|
||||||
if seriesRef == 0 && mint == 0 && maxt == 0 {
|
if seriesRef == 0 && mint == 0 && maxt == 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encoding.
|
// Encoding.
|
||||||
chkEnc := chunkenc.Encoding(mmapFile.byteSlice.Range(idx, idx+ChunkEncodingSize)[0])
|
chkEnc := chunkenc.Encoding(mmapFile.byteSlice.Range(idx, idx+ChunkEncodingSize)[0])
|
||||||
idx += ChunkEncodingSize
|
idx += ChunkEncodingSize
|
||||||
|
|
|
@ -116,7 +116,7 @@ func TestChunkDiskMapper_WriteChunk_Chunk_IterateChunks(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addChunks(100)
|
addChunks(100)
|
||||||
hrw.CutNewFile()
|
require.NoError(t, hrw.CutNewFile())
|
||||||
addChunks(10) // For chunks in in-memory buffer.
|
addChunks(10) // For chunks in in-memory buffer.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ func TestChunkDiskMapper_Truncate(t *testing.T) {
|
||||||
|
|
||||||
// Create segments 1 to 7.
|
// Create segments 1 to 7.
|
||||||
for i := 1; i <= 7; i++ {
|
for i := 1; i <= 7; i++ {
|
||||||
hrw.CutNewFile()
|
require.NoError(t, hrw.CutNewFile())
|
||||||
mint := int64(addChunk())
|
mint := int64(addChunk())
|
||||||
if i == 3 {
|
if i == 3 {
|
||||||
thirdFileMinT = mint
|
thirdFileMinT = mint
|
||||||
|
@ -453,7 +453,7 @@ func TestHeadReadWriter_ReadRepairOnEmptyLastFile(t *testing.T) {
|
||||||
nonEmptyFile := func() {
|
nonEmptyFile := func() {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
hrw.CutNewFile()
|
require.NoError(t, hrw.CutNewFile())
|
||||||
addChunk()
|
addChunk()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue