@@ -13,6 +13,7 @@ import (
13
13
"testing"
14
14
"time"
15
15
16
+ "github.com/cockroachdb/cockroach/pkg/kv/kvserver"
16
17
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/allocator/allocatorimpl"
17
18
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/asim/assertion"
18
19
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/asim/config"
@@ -509,25 +510,29 @@ func TestDataDriven(t *testing.T) {
509
510
}
510
511
return ""
511
512
case "setting" :
513
+ scanIfExists (t , d , "replicate_queue_enabled" , & settingsGen .Settings .ReplicateQueueEnabled )
514
+ scanIfExists (t , d , "lease_queue_enabled" , & settingsGen .Settings .LeaseQueueEnabled )
515
+ scanIfExists (t , d , "split_queue_enabled" , & settingsGen .Settings .SplitQueueEnabled )
516
+ scanIfExists (t , d , "rebalance_interval" , & settingsGen .Settings .LBRebalancingInterval )
517
+ scanIfExists (t , d , "split_qps_threshold" , & settingsGen .Settings .SplitQPSThreshold )
518
+ scanIfExists (t , d , "rebalance_range_threshold" , & settingsGen .Settings .RangeRebalanceThreshold )
519
+ scanIfExists (t , d , "gossip_delay" , & settingsGen .Settings .StateExchangeDelay )
520
+ scanIfExists (t , d , "range_size_split_threshold" , & settingsGen .Settings .RangeSizeSplitThreshold )
521
+ scanIfExists (t , d , "rebalance_objective" , & settingsGen .Settings .LBRebalancingObjective )
512
522
var delay time.Duration
513
523
if isDelayed := scanIfExists (t , d , "delay" , & delay ); isDelayed {
514
524
var rebalanceMode int64
515
525
scanIfExists (t , d , "rebalance_mode" , & rebalanceMode )
516
526
eventGen .ScheduleEvent (settingsGen .Settings .StartTime , delay , event.SetSimulationSettingsEvent {
517
- Key : "LBRebalancingMode" ,
518
- Value : rebalanceMode ,
527
+ IsClusterSetting : true ,
528
+ Key : "LBRebalancingMode" ,
529
+ Value : rebalanceMode ,
519
530
})
520
531
} else {
521
- scanIfExists (t , d , "replicate_queue_enabled" , & settingsGen .Settings .ReplicateQueueEnabled )
522
- scanIfExists (t , d , "lease_queue_enabled" , & settingsGen .Settings .LeaseQueueEnabled )
523
- scanIfExists (t , d , "split_queue_enabled" , & settingsGen .Settings .SplitQueueEnabled )
524
- scanIfExists (t , d , "rebalance_mode" , & settingsGen .Settings .LBRebalancingMode )
525
- scanIfExists (t , d , "rebalance_interval" , & settingsGen .Settings .LBRebalancingInterval )
526
- scanIfExists (t , d , "split_qps_threshold" , & settingsGen .Settings .SplitQPSThreshold )
527
- scanIfExists (t , d , "rebalance_range_threshold" , & settingsGen .Settings .RangeRebalanceThreshold )
528
- scanIfExists (t , d , "gossip_delay" , & settingsGen .Settings .StateExchangeDelay )
529
- scanIfExists (t , d , "range_size_split_threshold" , & settingsGen .Settings .RangeSizeSplitThreshold )
530
- scanIfExists (t , d , "rebalance_objective" , & settingsGen .Settings .LBRebalancingObjective )
532
+ var rebalanceMode int64
533
+ if exists := scanIfExists (t , d , "rebalance_mode" , & rebalanceMode ); exists {
534
+ kvserver .LoadBasedRebalancingMode .Override (ctx , & settingsGen .Settings .ST .SV , kvserver .LBRebalancingMode (rebalanceMode ))
535
+ }
531
536
}
532
537
return ""
533
538
case "print" :
0 commit comments