mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fix tests, set version when initializing the index writer
This commit is contained in:
parent
44052bc937
commit
510dc17066
|
@ -42,7 +42,7 @@ func TestSetCompactionFailed(t *testing.T) {
|
||||||
func createEmptyBlock(t *testing.T, dir string) *Block {
|
func createEmptyBlock(t *testing.T, dir string) *Block {
|
||||||
testutil.Ok(t, os.MkdirAll(dir, 0777))
|
testutil.Ok(t, os.MkdirAll(dir, 0777))
|
||||||
|
|
||||||
testutil.Ok(t, writeMetaFile(dir, &BlockMeta{}))
|
testutil.Ok(t, writeMetaFile(dir, &BlockMeta{Version: 2}))
|
||||||
|
|
||||||
ir, err := index.NewWriter(filepath.Join(dir, indexFilename))
|
ir, err := index.NewWriter(filepath.Join(dir, indexFilename))
|
||||||
testutil.Ok(t, err)
|
testutil.Ok(t, err)
|
||||||
|
|
|
@ -168,6 +168,8 @@ func NewWriter(fn string) (*Writer, error) {
|
||||||
symbols: make(map[string]uint32, 1<<13),
|
symbols: make(map[string]uint32, 1<<13),
|
||||||
seriesOffsets: make(map[uint64]uint64, 1<<16),
|
seriesOffsets: make(map[uint64]uint64, 1<<16),
|
||||||
crc32: newCRC32(),
|
crc32: newCRC32(),
|
||||||
|
|
||||||
|
Version: 2,
|
||||||
}
|
}
|
||||||
if err := iw.writeMeta(); err != nil {
|
if err := iw.writeMeta(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue