@@ -908,7 +908,7 @@ func TestCompaction(t *testing.T) {
908
908
fmt .Fprintln (& compactionLog , info .String ())
909
909
},
910
910
}
911
- reset := func (minVersion , maxVersion FormatMajorVersion ) {
911
+ reset := func (minVersion , maxVersion FormatMajorVersion , cmp * Comparer ) {
912
912
compactionLog .Reset ()
913
913
if d != nil {
914
914
require .NoError (t , closeAllSnapshots (d ))
@@ -924,6 +924,7 @@ func TestCompaction(t *testing.T) {
924
924
EventListener : compactionLogEventListener ,
925
925
FormatMajorVersion : randVersion (minVersion , maxVersion ),
926
926
Logger : testutils.Logger {T : t },
927
+ Comparer : cmp ,
927
928
}
928
929
opts .WithFSDefaults ()
929
930
opts .Experimental .CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest ()
@@ -971,13 +972,13 @@ func TestCompaction(t *testing.T) {
971
972
d .mu .compact .compactingCount --
972
973
}
973
974
974
- runTest := func (t * testing.T , testData string , minVersion , maxVersion FormatMajorVersion , verbose bool ) {
975
- reset (minVersion , maxVersion )
975
+ runTest := func (t * testing.T , testData string , minVersion , maxVersion FormatMajorVersion , verbose bool , cmp * Comparer ) {
976
+ reset (minVersion , maxVersion , cmp )
976
977
var ongoingCompaction * tableCompaction
977
978
datadriven .RunTest (t , testData , func (t * testing.T , td * datadriven.TestData ) string {
978
979
switch td .Cmd {
979
980
case "reset" :
980
- reset (minVersion , maxVersion )
981
+ reset (minVersion , maxVersion , cmp )
981
982
return ""
982
983
983
984
case "batch" :
@@ -1028,6 +1029,9 @@ func TestCompaction(t *testing.T) {
1028
1029
DisableAutomaticCompactions : true ,
1029
1030
Logger : testutils.Logger {T : t },
1030
1031
}
1032
+ if cmp != nil {
1033
+ opts .Comparer = cmp
1034
+ }
1031
1035
opts .WithFSDefaults ()
1032
1036
opts .Experimental .CompactionScheduler = NewConcurrencyLimitSchedulerWithNoPeriodicGrantingForTest ()
1033
1037
if d != nil {
@@ -1453,6 +1457,7 @@ func TestCompaction(t *testing.T) {
1453
1457
minVersion FormatMajorVersion // inclusive, FormatMinSupported if unspecified.
1454
1458
maxVersion FormatMajorVersion // inclusive, internalFormatNewest if unspecified.
1455
1459
verbose bool
1460
+ cmp * Comparer
1456
1461
}
1457
1462
testConfigs := map [string ]testConfig {
1458
1463
"singledel_set_with_del" : {},
@@ -1483,6 +1488,12 @@ func TestCompaction(t *testing.T) {
1483
1488
maxVersion : FormatValueSeparation ,
1484
1489
verbose : true ,
1485
1490
},
1491
+ "mvcc_garbage_blob" : {
1492
+ minVersion : FormatValueSeparation ,
1493
+ maxVersion : FormatValueSeparation ,
1494
+ verbose : true ,
1495
+ cmp : testkeys .Comparer ,
1496
+ },
1486
1497
"score_compaction_picked_before_manual" : {
1487
1498
// Run at a specific version, so that a single sstable format is used,
1488
1499
// since the test prints the compaction log which includes file sizes.
@@ -1513,7 +1524,7 @@ func TestCompaction(t *testing.T) {
1513
1524
if maxVersion == 0 {
1514
1525
maxVersion = internalFormatNewest
1515
1526
}
1516
- runTest (t , path , minVersion , maxVersion , tc .verbose )
1527
+ runTest (t , path , minVersion , maxVersion , tc .verbose , tc . cmp )
1517
1528
})
1518
1529
}
1519
1530
@@ -1592,14 +1603,14 @@ func TestCompactionDeleteOnlyHints(t *testing.T) {
1592
1603
// Collection of table stats can trigger compactions. As we want full
1593
1604
// control over when compactions are run, disable stats by default.
1594
1605
DisableTableStats : true ,
1595
- //EventListener: &EventListener{
1606
+ // EventListener: &EventListener{
1596
1607
// CompactionEnd: func(info CompactionInfo) {
1597
1608
// if compactInfo != nil {
1598
1609
// return
1599
1610
// }
1600
1611
// compactInfo = &info
1601
1612
// },
1602
- //},
1613
+ // },
1603
1614
EventListener : & el ,
1604
1615
FormatMajorVersion : internalFormatNewest ,
1605
1616
Logger : testutils.Logger {T : t },
0 commit comments