@@ -518,6 +518,9 @@ var tpccSupportedWarehouses = []struct {
518
518
{hardware : "ibm-n5cpu16" , v : version .MustParse (`v19.1.0-alpha.0` ), warehouses : 1300 },
519
519
// Ditto.
520
520
{hardware : "gce-n5cpu16" , v : version .MustParse (`v2.1.0-alpha.0` ), warehouses : 1300 },
521
+
522
+ {hardware : "gce-n6cpu16" , v : version .MustParse (`v19.1.0-alpha.0` ), warehouses : 2000 },
523
+ {hardware : "gce-n6cpu16" , v : version .MustParse (`v2.1.0-alpha.0` ), warehouses : 2000 },
521
524
}
522
525
523
526
// tpccMaxRate calculates the max rate of the workload given a number of warehouses.
@@ -560,7 +563,7 @@ func maxSupportedTPCCWarehouses(
560
563
// workload is running. The number of database upgrades is randomized
561
564
// by the mixed-version framework which chooses a random predecessor version
562
565
// and upgrades until it reaches the current version.
563
- func runTPCCMixedHeadroom (ctx context.Context , t test.Test , c cluster.Cluster ) {
566
+ func runTPCCMixedHeadroom (ctx context.Context , t test.Test , c cluster.Cluster , chaos bool ) {
564
567
maxWarehouses := maxSupportedTPCCWarehouses (* t .BuildVersion (), c .Cloud (), c .Spec ())
565
568
headroomWarehouses := int (float64 (maxWarehouses ) * 0.7 )
566
569
@@ -569,20 +572,39 @@ func runTPCCMixedHeadroom(ctx context.Context, t test.Test, c cluster.Cluster) {
569
572
// The full 6.5m import ran into out of disk errors (on 250gb machines),
570
573
// hence division by two.
571
574
bankRows := 65104166 / 2
575
+
572
576
if c .IsLocal () {
573
577
bankRows = 1000
574
578
}
579
+ // If the test is a chaos test, we decrease the number of rows and warehouses
580
+ // in order to lower the time it takes to reach replication with a larger cluster.
581
+ if chaos {
582
+ bankRows = 1000
583
+ headroomWarehouses = 200
584
+ }
575
585
576
- mvt := mixedversion .NewTest (
577
- ctx , t , t .L (), c , c .CRDBNodes (),
586
+ customOpts := []mixedversion.CustomOption {
578
587
// We test only upgrades from 23.2 in this test because it uses
579
588
// the `workload fixtures import` command, which is only supported
580
589
// reliably multi-tenant mode starting from that version.
581
590
mixedversion .MinimumSupportedVersion ("v23.2.0" ),
582
591
// We limit the total number of plan steps to 70, which is roughly 80% of all plan lengths.
583
592
// See #138014 for more details.
584
593
mixedversion .MaxNumPlanSteps (70 ),
585
- )
594
+ }
595
+
596
+ // If the test is a chaos test, we want to opt for the more expansive panic
597
+ // mutator, as well any other appropriate test opts for the unique test.
598
+ if chaos {
599
+ customOpts = append ([]mixedversion.CustomOption {
600
+ mixedversion .NeverUseFixtures ,
601
+ mixedversion .EnableHooksDuringFailureInjection ,
602
+ },
603
+ customOpts ... )
604
+ }
605
+
606
+ mvt := mixedversion .NewTest (
607
+ ctx , t , t .L (), c , c .CRDBNodes (), customOpts ... )
586
608
587
609
tenantFeaturesEnabled := make (chan struct {})
588
610
enableTenantFeatures := func (ctx context.Context , l * logger.Logger , rng * rand.Rand , h * mixedversion.Helper ) error {
@@ -594,7 +616,7 @@ func runTPCCMixedHeadroom(ctx context.Context, t test.Test, c cluster.Cluster) {
594
616
l .Printf ("waiting for tenant features to be enabled" )
595
617
<- tenantFeaturesEnabled
596
618
597
- randomNode := c .Node (c . CRDBNodes ().SeededRandNode (rng )[0 ])
619
+ randomNode := c .Node (h . AvailableNodes ().SeededRandNode (rng )[0 ])
598
620
cmd := tpccImportCmdWithCockroachBinary (test .DefaultCockroachPath , "" , "tpcc" , headroomWarehouses , fmt .Sprintf ("{pgurl%s}" , randomNode ))
599
621
return c .RunE (ctx , option .WithNodes (randomNode ), cmd )
600
622
}
@@ -603,7 +625,7 @@ func runTPCCMixedHeadroom(ctx context.Context, t test.Test, c cluster.Cluster) {
603
625
// upgrade machinery, in which a) all ranges are touched and b) work proportional
604
626
// to the amount data may be carried out.
605
627
importLargeBank := func (ctx context.Context , l * logger.Logger , rng * rand.Rand , h * mixedversion.Helper ) error {
606
- randomNode := c .Node (c . CRDBNodes ().SeededRandNode (rng )[0 ])
628
+ randomNode := c .Node (h . AvailableNodes ().SeededRandNode (rng )[0 ])
607
629
// Upload a versioned cockroach binary to the random node. The bank workload
608
630
// is no longer backwards compatible after #149374, so we need to use the same
609
631
// version as the cockroach cluster.
@@ -647,7 +669,7 @@ func runTPCCMixedHeadroom(ctx context.Context, t test.Test, c cluster.Cluster) {
647
669
labelsMap = getTpccLabels (headroomWarehouses , rampDur , workloadDur / time .Millisecond , nil )
648
670
}
649
671
cmd := roachtestutil .NewCommand ("./cockroach workload run tpcc" ).
650
- Arg ("{pgurl%s}" , c . CRDBNodes ()).
672
+ Arg ("{pgurl%s}" , h . AvailableNodes ()).
651
673
Flag ("duration" , workloadDur ).
652
674
Flag ("warehouses" , headroomWarehouses ).
653
675
Flag ("histograms" , histogramsPath ).
@@ -728,6 +750,21 @@ func registerTPCC(r registry.Registry) {
728
750
})
729
751
},
730
752
})
753
+ mixedHeadroomChaosSpec := r .MakeClusterSpec (6 , spec .CPU (16 ), spec .WorkloadNode (), spec .RandomlyUseZfs ())
754
+ r .Add (registry.TestSpec {
755
+ Name : "tpcc/mixed-headroom/chaos/" + mixedHeadroomChaosSpec .String (),
756
+ Timeout : 7 * time .Hour ,
757
+ Owner : registry .OwnerTestEng ,
758
+ CompatibleClouds : registry .AllClouds .NoAWS ().NoIBM (),
759
+ Suites : registry .Suites (registry .MixedVersion ),
760
+ Cluster : mixedHeadroomChaosSpec ,
761
+ EncryptionSupport : registry .EncryptionMetamorphic ,
762
+ Monitor : true ,
763
+ Randomized : true ,
764
+ Run : func (ctx context.Context , t test.Test , c cluster.Cluster ) {
765
+ runTPCCMixedHeadroom (ctx , t , c , true )
766
+ },
767
+ })
731
768
732
769
mixedHeadroomSpec := r .MakeClusterSpec (5 , spec .CPU (16 ), spec .WorkloadNode (), spec .RandomlyUseZfs ())
733
770
r .Add (registry.TestSpec {
@@ -749,7 +786,7 @@ func registerTPCC(r registry.Registry) {
749
786
Monitor : true ,
750
787
Randomized : true ,
751
788
Run : func (ctx context.Context , t test.Test , c cluster.Cluster ) {
752
- runTPCCMixedHeadroom (ctx , t , c )
789
+ runTPCCMixedHeadroom (ctx , t , c , false )
753
790
},
754
791
})
755
792
0 commit comments