diff --git a/pkg/storage/bulk/sst_writer.go b/pkg/storage/bulk/sst_writer.go index 3e0dd0237b28..a17331b1ae96 100644 --- a/pkg/storage/bulk/sst_writer.go +++ b/pkg/storage/bulk/sst_writer.go @@ -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" @@ -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} }