Skip to content

Commit 1673d01

Browse files
craig[bot]DarrylWong
andcommitted
Merge #155106
155106: mixedversion: disable upreplication mutator r=srosenberg a=DarrylWong This mutator can cause timeouts upreplicating non trivial amounts of data. It should be default disabled except for curated tests. Informs: #142194 Fixes: #151984 Fixes: #154838 Release note: none Epic: none Co-authored-by: DarrylWong <[email protected]>
2 parents 4bba7f8 + 9a401e4 commit 1673d01

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ type (
355355
overriddenMutatorProbabilities map[string]float64
356356
hooksSupportFailureInjection bool
357357
workloadNodes option.NodeListOption
358+
enableUpReplication bool
358359
}
359360

360361
CustomOption func(*testOptions)
@@ -413,6 +414,12 @@ func EnableHooksDuringFailureInjection(opts *testOptions) {
413414
opts.hooksSupportFailureInjection = true
414415
}
415416

417+
// EnableUpReplication is an option that can be passed to `NewTest` to enable
418+
// up-replication to 5X before panicking a node during failure injection tests.
419+
func EnableUpReplication(opts *testOptions) {
420+
opts.enableUpReplication = true
421+
}
422+
416423
// NeverUseFixtures is an option that can be passed to `NewTest` to
417424
// disable the use of fixtures in the test. Necessary if the test
418425
// wants to use a number of cockroach nodes other than 4.

pkg/cmd/roachtest/roachtestutil/mixedversion/mutators.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ func (m panicNodeMutator) Generate(
411411

412412
// If we have at least 5 nodes, we can safely upreplicate to 5X before panicking a node.
413413
// This allows for a longer panic duration before recovery.
414-
supportsUpReplication := len(nodeList) >= 5
414+
supportsUpReplication := planner.options.enableUpReplication && len(nodeList) >= 5
415415

416416
for _, upgrade := range upgrades {
417417
possiblePointsInTime := upgrade.

pkg/cmd/roachtest/roachtestutil/mixedversion/testdata/planner/separate_process

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Plan:
4444
├── delete all-tenants override for the `version` key (9) [stage=system:tenant-setup;tenant:tenant-setup]
4545
├── run startup hooks concurrently
4646
│ ├── run "create tables" hookId="planner_test.go:141", after 3m0s delay (10) [stage=system:on-startup;tenant:on-startup]
47-
│ └── run "initialize bank workload" hookId="mixedversion.go:877", after 100ms delay (11) [stage=system:on-startup;tenant:on-startup]
48-
├── run "bank workload" hookId="mixedversion.go:885" (12) [stage=system:background;tenant:background]
47+
│ └── run "initialize bank workload" hookId="mixedversion.go:884", after 100ms delay (11) [stage=system:on-startup;tenant:on-startup]
48+
├── run "bank workload" hookId="mixedversion.go:892" (12) [stage=system:background;tenant:background]
4949
├── upgrade cluster from "v22.2.3" to "v23.1.4"
5050
│ ├── upgrade storage cluster
5151
│ │ ├── prevent auto-upgrades on system tenant by setting `preserve_downgrade_option` (13) [stage=system:init;tenant:upgrading-system]

pkg/cmd/roachtest/roachtestutil/mixedversion/testdata/planner/shared_process

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Plan:
5353
├── delete all-tenants override for the `version` key (16) [stage=system:tenant-setup;tenant:tenant-setup]
5454
├── run startup hooks concurrently
5555
│ ├── run "create tables" hookId="planner_test.go:141", after 30s delay (17) [stage=system:on-startup;tenant:on-startup]
56-
│ └── run "initialize bank workload" hookId="mixedversion.go:877", after 3m0s delay (18) [stage=system:on-startup;tenant:on-startup]
57-
├── run "bank workload" hookId="mixedversion.go:885" (19) [stage=system:background;tenant:background]
56+
│ └── run "initialize bank workload" hookId="mixedversion.go:884", after 3m0s delay (18) [stage=system:on-startup;tenant:on-startup]
57+
├── run "bank workload" hookId="mixedversion.go:892" (19) [stage=system:background;tenant:background]
5858
├── upgrade cluster from "v23.1.12" to "v23.2.0"
5959
│ ├── prevent auto-upgrades on system tenant by setting `preserve_downgrade_option` (20) [stage=system:init;tenant:init]
6060
│ ├── prevent auto-upgrades on mixed-version-tenant-cyvju tenant by setting `preserve_downgrade_option` (21) [stage=system:init;tenant:init]

pkg/cmd/roachtest/roachtestutil/mixedversion/testdata/planner/step_stages

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ Plan:
3535
├── install fixtures for version "v22.2.3" (1) [stage=system-setup]
3636
├── start cluster at version "v22.2.3" (2) [stage=system-setup]
3737
├── wait for all nodes (:1-4) to acknowledge cluster version '22.2' on system tenant (3) [stage=system-setup]
38-
├── run "initialize bank workload" hookId="mixedversion.go:877" (4) [stage=on-startup]
38+
├── run "initialize bank workload" hookId="mixedversion.go:884" (4) [stage=on-startup]
3939
├── start background hooks concurrently
40-
│ ├── run "bank workload" hookId="mixedversion.go:885", after 0s delay (5) [stage=background]
41-
│ └── run "csv server" hookId="mixedversion.go:854", after 0s delay (6) [stage=background]
40+
│ ├── run "bank workload" hookId="mixedversion.go:892", after 0s delay (5) [stage=background]
41+
│ └── run "csv server" hookId="mixedversion.go:861", after 0s delay (6) [stage=background]
4242
├── upgrade cluster from "v22.2.3" to "v23.1.4"
4343
│ ├── prevent auto-upgrades on system tenant by setting `preserve_downgrade_option` (7) [stage=init]
4444
│ ├── upgrade nodes :1-4 from "v22.2.3" to "v23.1.4"

pkg/cmd/roachtest/tests/tpcc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ func runTPCCMixedHeadroom(ctx context.Context, t test.Test, c cluster.Cluster, c
600600
customOpts = append([]mixedversion.CustomOption{
601601
mixedversion.NeverUseFixtures,
602602
mixedversion.EnableHooksDuringFailureInjection,
603+
mixedversion.EnableUpReplication,
603604
},
604605
customOpts...)
605606
}

0 commit comments

Comments
 (0)