Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
40888: bulk: disable two level index in Pebble r=pbardea a=pbardea

Setting the IndexBlockSize to MaxInt disables two level indexes. Using
two level indexes cause issues restoring some registration cluster
backups. This change servers as a work-around until
cockroachdb/pebble#285 is resolved.

Fixes cockroachdb#40670.

Release justification: RESTOREs on registration cluster backups started
failing after enabling two level indexes in Pebble. This was a release
blocking bug and this fix allows these backups to be restored again
until more investigation is done in the two level index issue.

Release note: None

Co-authored-by: Paul Bardea <[email protected]>
  • Loading branch information
craig[bot] and pbardea committed Sep 19, 2019
2 parents c6342c9 + 1a4b8c8 commit dd5aa30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/storage/bulk/sst_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package bulk
import (
"bytes"
"io"
"math"

"github.com/cockroachdb/cockroach/pkg/storage/engine"
"github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb"
Expand Down Expand Up @@ -108,7 +109,9 @@ var pebbleOpts = func() *pebble.Options {
// MakeSSTWriter creates a new SSTWriter.
func MakeSSTWriter() SSTWriter {
f := &memFile{}
sst := sstable.NewWriter(f, pebbleOpts, pebble.LevelOptions{BlockSize: 64 * 1024})
// Setting the IndexBlockSize to MaxInt disables twoLevelIndexes in Pebble.
// TODO(pbardea): Remove the IndexBlockSize option when https://github.com/cockroachdb/pebble/issues/285 is resolved.
sst := sstable.NewWriter(f, pebbleOpts, pebble.LevelOptions{BlockSize: 64 * 1024, IndexBlockSize: math.MaxInt32})
return SSTWriter{fw: sst, f: f}
}

Expand Down

0 comments on commit dd5aa30

Please sign in to comment.