Skip to content
4 changes: 2 additions & 2 deletions pkg/storage/stores/shipper/indexshipper/tsdb/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (b *Builder) Build(
name := fmt.Sprintf("%s-%x.staging", index.IndexFilename, rng)
tmpPath := filepath.Join(scratchDir, name)

var writer *index.Writer
var writer *index.Creator

writer, err = index.NewWriterWithVersion(ctx, b.version, tmpPath)
if err != nil {
Expand Down Expand Up @@ -169,7 +169,7 @@ func (b *Builder) Build(
}
}

if err := writer.Close(); err != nil {
if _, err := writer.Close(false); err != nil {
return id, err
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func TestChunkEncodingRoundTrip(t *testing.T) {
} {
t.Run(fmt.Sprintf("version %d nChks %d pageSize %d", version, nChks, pageSize), func(t *testing.T) {
chks := mkChks(nChks)
var w Writer
var w Creator
w.Version = version
primary := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
scratch := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
Expand Down Expand Up @@ -583,7 +583,7 @@ func TestSearchWithPageMarkers(t *testing.T) {
},
} {
t.Run(fmt.Sprintf("%s-pagesize-%d", tc.desc, pageSize), func(t *testing.T) {
var w Writer
var w Creator
w.Version = FormatV3
primary := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
scratch := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
Expand Down Expand Up @@ -697,7 +697,7 @@ func TestDecoderChunkStats(t *testing.T) {
},
} {
t.Run(fmt.Sprintf("%s_version=%d_pageSize=%d", tc.desc, version, pageSize), func(t *testing.T) {
var w Writer
var w Creator
w.Version = version
primary := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
scratch := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
Expand All @@ -722,7 +722,7 @@ func BenchmarkChunkStats(b *testing.B) {
from, through := int64(nChks*40/100), int64(nChks*60/100)
for _, version := range []int{FormatV2, FormatV3} {
b.Run(fmt.Sprintf("version %d/%d chunks", version, nChks), func(b *testing.B) {
var w Writer
var w Creator
w.Version = version
primary := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
scratch := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
Expand All @@ -747,7 +747,7 @@ func BenchmarkReadChunks(b *testing.B) {
from, through := int64(nChks*40/100), int64(nChks*60/100)
for _, version := range []int{FormatV2, FormatV3} {
b.Run(fmt.Sprintf("version %d/%d chunks", version, nChks), func(b *testing.B) {
var w Writer
var w Creator
w.Version = version
primary := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
scratch := encoding.EncWrap(tsdb_enc.Encbuf{B: make([]byte, 0)})
Expand Down
Loading
Loading