Skip to content

Commit 436c169

Browse files
committed
db: remove EnableColumnarBlocks option
Remove the ability to disable columnar blocks; columnar blocks are now always enabled on a sufficiently high format major version.
1 parent 453a721 commit 436c169

20 files changed

+27
-113
lines changed

checkpoint_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ func testCheckpointImpl(t *testing.T, ddFile string, createOnShared bool) {
4545
DisableAutomaticCompactions: true,
4646
Logger: testLogger{t},
4747
}
48-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
4948
opts.Experimental.RemoteStorage = remote.MakeSimpleFactory(map[remote.Locator]remote.Storage{
5049
"": remoteMem,
5150
})

cmd/pebble/db.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ func newPebbleDB(dir string) DB {
7676
return 1, 3
7777
},
7878
}
79-
// In FormatColumnarBlocks (the value of FormatNewest at the time of
80-
// writing), columnar blocks are only written if explicitly opted into.
81-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
8279
// Enable value separation. Note the minimum size of 512 means that only the
8380
// variant of the ycsb benchmarks that uses 1024 values will result in any
8481
// value separation.

compaction_picker_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,6 @@ func TestCompactionPickerPickFile(t *testing.T) {
13211321
FormatMajorVersion: FormatNewest,
13221322
FS: fs,
13231323
}
1324-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
13251324
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
13261325

13271326
d, err := Open("", opts)
@@ -1465,7 +1464,6 @@ func TestCompactionPickerScores(t *testing.T) {
14651464
FormatMajorVersion: FormatNewest,
14661465
FS: fs,
14671466
}
1468-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
14691467
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
14701468

14711469
d, err := Open("", opts)

compaction_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,6 @@ func TestCompaction(t *testing.T) {
924924
FormatMajorVersion: randVersion(minVersion, maxVersion),
925925
}
926926
opts.WithFSDefaults()
927-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
928927
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
929928

930929
var err error
@@ -1027,7 +1026,6 @@ func TestCompaction(t *testing.T) {
10271026
DisableAutomaticCompactions: true,
10281027
}
10291028
opts.WithFSDefaults()
1030-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
10311029
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
10321030
if d != nil {
10331031
opts.CompactionConcurrencyRange = d.opts.CompactionConcurrencyRange
@@ -1592,7 +1590,6 @@ func TestCompactionDeleteOnlyHints(t *testing.T) {
15921590
}
15931591
opts.WithFSDefaults()
15941592
opts.Experimental.EnableDeleteOnlyCompactionExcises = func() bool { return true }
1595-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
15961593
return opts, nil
15971594
}
15981595

@@ -1902,7 +1899,6 @@ func TestCompactionTombstones(t *testing.T) {
19021899
}
19031900
opts.WithFSDefaults()
19041901
opts.Experimental.EnableDeleteOnlyCompactionExcises = func() bool { return true }
1905-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
19061902
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
19071903
var err error
19081904
d, err = runDBDefineCmd(td, opts)
@@ -2761,7 +2757,6 @@ func TestMarkedForCompaction(t *testing.T) {
27612757
},
27622758
}
27632759
opts.WithFSDefaults()
2764-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
27652760

27662761
reset := func() {
27672762
if d != nil {
@@ -3382,7 +3377,6 @@ func TestTombstoneDensityCompactionMoveOptimization(t *testing.T) {
33823377
opts := DefaultOptions()
33833378
opts.Experimental.TombstoneDenseCompactionThreshold = 0.5 // Lower for test
33843379
opts.Experimental.NumDeletionsThreshold = 1
3385-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
33863380
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
33873381
opts.WithFSDefaults()
33883382

@@ -3481,7 +3475,6 @@ func TestTombstoneDensityCompactionMoveOptimization_NoMoveWithOverlap(t *testing
34813475
opts := DefaultOptions()
34823476
opts.Experimental.TombstoneDenseCompactionThreshold = 0.5 // Lower for test
34833477
opts.Experimental.NumDeletionsThreshold = 1
3484-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
34853478
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
34863479
opts.WithFSDefaults()
34873480

@@ -3561,7 +3554,6 @@ func TestTombstoneDensityCompactionMoveOptimization_GrandparentOverlapTooLarge(t
35613554
opts := DefaultOptions()
35623555
opts.Experimental.TombstoneDenseCompactionThreshold = 0.5
35633556
opts.Experimental.NumDeletionsThreshold = 1
3564-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
35653557
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
35663558
opts.WithFSDefaults()
35673559

@@ -3624,7 +3616,6 @@ func TestTombstoneDensityCompactionMoveOptimization_BelowDensityThreshold(t *tes
36243616
opts := DefaultOptions()
36253617
opts.Experimental.TombstoneDenseCompactionThreshold = 0.9 // Set high threshold
36263618
opts.Experimental.NumDeletionsThreshold = 1
3627-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
36283619
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
36293620
opts.WithFSDefaults()
36303621

@@ -3672,7 +3663,6 @@ func TestTombstoneDensityCompactionMoveOptimization_InvalidStats(t *testing.T) {
36723663
opts := DefaultOptions()
36733664
opts.Experimental.TombstoneDenseCompactionThreshold = 0.5
36743665
opts.Experimental.NumDeletionsThreshold = 1
3675-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
36763666
opts.Experimental.CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest()
36773667
opts.WithFSDefaults()
36783668

event_listener_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ func TestEventListener(t *testing.T) {
7777
L0CompactionThreshold: 10,
7878
WALDir: "wal",
7979
}
80-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
8180
var err error
8281
d, err = Open("db", opts)
8382
if err != nil {

external_iterator_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ func TestExternalIterator(t *testing.T) {
2828
FormatMajorVersion: internalFormatNewest,
2929
Comparer: testkeys.Comparer,
3030
}
31-
o.Experimental.EnableColumnarBlocks = func() bool { return true }
3231
o.testingRandomized(t)
3332
o.EnsureDefaults()
3433
d, err := Open("", o)

format_major_version.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -428,20 +428,14 @@ func (d *DB) TableFormat() sstable.TableFormat {
428428
// The table is typically written at the maximum allowable format implied by
429429
// the current format major version of the DB.
430430
f := d.FormatMajorVersion().MaxTableFormat()
431-
switch f {
432-
case sstable.TableFormatPebblev3:
431+
if f == sstable.TableFormatPebblev3 {
433432
// In format major versions with maximum table formats of Pebblev3,
434433
// value blocks were conditional on an experimental setting. In format
435434
// major versions with maximum table formats of Pebblev4 and higher,
436435
// value blocks are always enabled.
437436
if d.opts.Experimental.EnableValueBlocks == nil || !d.opts.Experimental.EnableValueBlocks() {
438437
f = sstable.TableFormatPebblev2
439438
}
440-
default:
441-
if f.BlockColumnar() && (d.opts.Experimental.EnableColumnarBlocks == nil ||
442-
!d.opts.Experimental.EnableColumnarBlocks()) {
443-
f = sstable.TableFormatPebblev4
444-
}
445439
}
446440
return f
447441
}

format_major_version_test.go

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -266,69 +266,39 @@ func TestFormatMajorVersions_BlobFileFormat(t *testing.T) {
266266
require.Panics(t, func() { _ = (FormatValueSeparation - 1).MaxBlobFileFormat() })
267267
}
268268

269-
// TestFormatMajorVersions_ColumnarBlocks ensures that
270-
// Experimental.EnableColumnarBlocks is respected on recent format major
271-
// versions.
272-
func TestFormatMajorVersions_ColumnarBlocks(t *testing.T) {
269+
func TestFormatMajorVersions_MaxTableFormat(t *testing.T) {
273270
type testCase struct {
274-
fmv FormatMajorVersion
275-
colBlks bool
276-
want sstable.TableFormat
271+
fmv FormatMajorVersion
272+
want sstable.TableFormat
277273
}
278274
testCases := []testCase{
279275
{
280-
fmv: FormatTableFormatV6,
281-
colBlks: true,
282-
want: sstable.TableFormatPebblev6,
276+
fmv: FormatTableFormatV6,
277+
want: sstable.TableFormatPebblev6,
283278
},
284279
{
285-
fmv: FormatTableFormatV6,
286-
colBlks: false,
287-
want: sstable.TableFormatPebblev4,
280+
fmv: FormatColumnarBlocks,
281+
want: sstable.TableFormatPebblev5,
288282
},
289283
{
290-
fmv: FormatColumnarBlocks,
291-
colBlks: true,
292-
want: sstable.TableFormatPebblev5,
284+
fmv: FormatFlushableIngestExcises,
285+
want: sstable.TableFormatPebblev4,
293286
},
294287
{
295-
fmv: FormatColumnarBlocks,
296-
colBlks: false,
297-
want: sstable.TableFormatPebblev4,
288+
fmv: formatDeprecatedExperimentalValueSeparation,
289+
want: sstable.TableFormatPebblev6,
298290
},
299291
{
300-
fmv: FormatFlushableIngestExcises,
301-
colBlks: true,
302-
want: sstable.TableFormatPebblev4,
303-
},
304-
{
305-
fmv: FormatNewest,
306-
colBlks: false,
307-
want: sstable.TableFormatPebblev4,
308-
},
309-
{
310-
fmv: formatDeprecatedExperimentalValueSeparation,
311-
colBlks: true,
312-
want: sstable.TableFormatPebblev6,
313-
},
314-
{
315-
fmv: formatDeprecatedExperimentalValueSeparation,
316-
colBlks: false,
317-
want: sstable.TableFormatPebblev4,
318-
},
319-
{
320-
fmv: FormatNewest,
321-
colBlks: true,
322-
want: sstable.TableFormatPebblev7,
292+
fmv: FormatNewest,
293+
want: sstable.TableFormatPebblev7,
323294
},
324295
}
325296
for _, tc := range testCases {
326-
t.Run(fmt.Sprintf("(%s,%t)", tc.fmv, tc.colBlks), func(t *testing.T) {
297+
t.Run(tc.fmv.String(), func(t *testing.T) {
327298
opts := &Options{
328299
FS: vfs.NewMem(),
329300
FormatMajorVersion: tc.fmv,
330301
}
331-
opts.Experimental.EnableColumnarBlocks = func() bool { return tc.colBlks }
332302
d, err := Open("", opts)
333303
require.NoError(t, err)
334304
defer func() { _ = d.Close() }()

ingest_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ func TestOverlappingIngestedSSTs(t *testing.T) {
500500
Logger: testLogger{t},
501501
}
502502
opts.WithFSDefaults()
503-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
504503
if testing.Verbose() {
505504
lel := MakeLoggingEventListener(DefaultLogger)
506505
opts.EventListener = &lel
@@ -1172,7 +1171,6 @@ func TestIngestExternal(t *testing.T) {
11721171
FormatMajorVersion: majorVersion,
11731172
Logger: testLogger{t},
11741173
}
1175-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
11761174
opts.Experimental.RemoteStorage = remote.MakeSimpleFactory(map[remote.Locator]remote.Storage{
11771175
"external-locator": remoteStorage,
11781176
})
@@ -1702,7 +1700,6 @@ func TestIngest(t *testing.T) {
17021700
}},
17031701
FormatMajorVersion: internalFormatNewest,
17041702
}
1705-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
17061703
opts.Experimental.IngestSplit = func() bool {
17071704
return split
17081705
}

iterator_histories_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ func TestIterHistories(t *testing.T) {
5353
},
5454
Logger: testLogger{t},
5555
}
56-
opts.Experimental.EnableColumnarBlocks = func() bool { return true }
5756
opts.DisableAutomaticCompactions = true
5857
opts.EnsureDefaults()
5958
opts.WithFSDefaults()

0 commit comments

Comments
 (0)