Skip to content

Commit

Permalink
mixedversion: rename finalizeUpgrade step to allowUpgrade
Browse files Browse the repository at this point in the history
In the near future, we will randomly change the timing of this step so
that it is not immediately followed by migrations, as the name
previously suggested.

Epic: none

Release note: None
  • Loading branch information
renatolabs committed Feb 1, 2024
1 parent a05283d commit 9647c54
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
12 changes: 6 additions & 6 deletions pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,21 +860,21 @@ func (s restartWithNewBinaryStep) Run(
)
}

// finalizeUpgradeStep resets the `preserve_downgrade_option` cluster
// allowUpgradeStep resets the `preserve_downgrade_option` cluster
// setting, allowing the upgrade migrations to run and the cluster
// version to eventually reach the binary version on the nodes.
type finalizeUpgradeStep struct {
type allowUpgradeStep struct {
crdbNodes option.NodeListOption
prng *rand.Rand
}

func (s finalizeUpgradeStep) Background() shouldStop { return nil }
func (s allowUpgradeStep) Background() shouldStop { return nil }

func (s finalizeUpgradeStep) Description() string {
return "finalize upgrade by resetting `preserve_downgrade_option`"
func (s allowUpgradeStep) Description() string {
return "allow upgrade to happen by resetting `preserve_downgrade_option`"
}

func (s finalizeUpgradeStep) Run(
func (s allowUpgradeStep) Run(
ctx context.Context, l *logger.Logger, c cluster.Cluster, h *Helper,
) error {
node, db := h.RandomDB(s.prng, s.crdbNodes)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/roachtestutil/mixedversion/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ func (p *testPlanner) finalizeUpgradeSteps(
p.currentContext.Finalizing = true
p.currentContext.Stage = RunningUpgradeMigrationsStage
runMigrations := p.newSingleStep(
finalizeUpgradeStep{prng: p.newRNG(), crdbNodes: p.crdbNodes},
allowUpgradeStep{prng: p.newRNG(), crdbNodes: p.crdbNodes},
)
var mixedVersionStepsDuringMigrations []testStep
if scheduleHooks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ mixed-version test plan for upgrading from "v22.2.8" to "<current>":
│ ├── restart node 1 with binary version <current> (13)
│ ├── run "mixed-version 1" (14)
│ └── restart node 3 with binary version <current> (15)
├── finalize upgrade by resetting `preserve_downgrade_option` (16)
├── allow upgrade to happen by resetting `preserve_downgrade_option` (16)
├── run "mixed-version 2" (17)
└── wait for nodes :1-4 to reach cluster version <current> (18)
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ mixed-version test plan for upgrading from "v22.2.8" to "<current>" with mutator
│ ├── testSingleStep (17) [stage=last-upgrade]
│ ├── restart node 1 with binary version <current> (18) [stage=last-upgrade]
│ └── restart node 3 with binary version <current> (19) [stage=last-upgrade]
├── finalize upgrade by resetting `preserve_downgrade_option` (20) [stage=running-upgrade-migrations]
├── allow upgrade to happen by resetting `preserve_downgrade_option` (20) [stage=running-upgrade-migrations]
└── wait for nodes :1-4 to reach cluster version <current> (21) [stage=running-upgrade-migrations]
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ mixed-version test plan for upgrading from "v22.2.3" to "v23.1.4" to "v23.2.0" t
│ │ ├── wait for 30s (15)
│ │ ├── restart node 4 with binary version v23.1.4 (16)
│ │ └── restart node 2 with binary version v23.1.4 (17)
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (18)
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (18)
│ └── wait for nodes :1-4 to reach cluster version '23.1' (19)
├── run "initialize bank workload" (20)
├── start background hooks concurrently
Expand All @@ -65,7 +65,7 @@ mixed-version test plan for upgrading from "v22.2.3" to "v23.1.4" to "v23.2.0" t
│ │ ├── restart node 1 with binary version v23.2.0 (27)
│ │ ├── restart node 2 with binary version v23.2.0 (28)
│ │ └── restart node 3 with binary version v23.2.0 (29)
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (30)
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (30)
│ ├── wait for nodes :1-4 to reach cluster version '23.2' (31)
│ └── run "validate upgrade" (32)
└── upgrade cluster from "v23.2.0" to "<current>"
Expand All @@ -91,7 +91,7 @@ mixed-version test plan for upgrading from "v22.2.3" to "v23.1.4" to "v23.2.0" t
│ ├── run "mixed-version 2" (49)
│ ├── restart node 2 with binary version <current> (50)
│ └── restart node 3 with binary version <current> (51)
├── finalize upgrade by resetting `preserve_downgrade_option` (52)
├── allow upgrade to happen by resetting `preserve_downgrade_option` (52)
├── run "mixed-version 2" (53)
├── wait for nodes :1-4 to reach cluster version <current> (54)
└── run "validate upgrade" (55)
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ │ ├── wait for 5m0s (15)
│ │ ├── restart node 4 with binary version v22.1.8 (16)
│ │ └── restart node 2 with binary version v22.1.8 (17)
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (18)
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (18)
│ └── wait for nodes :1-4 to reach cluster version '22.1' (19)
├── upgrade cluster from "v22.1.8" to "v22.2.3"
│ ├── prevent auto-upgrades by setting `preserve_downgrade_option` (20)
Expand All @@ -59,7 +59,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ │ ├── restart node 1 with binary version v22.2.3 (23)
│ │ ├── restart node 2 with binary version v22.2.3 (24)
│ │ └── restart node 3 with binary version v22.2.3 (25)
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (26)
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (26)
│ └── wait for nodes :1-4 to reach cluster version '22.2' (27)
├── upgrade cluster from "v22.2.3" to "v23.1.4"
│ ├── prevent auto-upgrades by setting `preserve_downgrade_option` (28)
Expand All @@ -69,7 +69,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ │ ├── restart node 3 with binary version v23.1.4 (31)
│ │ ├── restart node 4 with binary version v23.1.4 (32)
│ │ └── wait for 10m0s (33)
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (34)
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (34)
│ └── wait for nodes :1-4 to reach cluster version '23.1' (35)
├── run "initialize bank workload" (36)
├── start background hooks concurrently
Expand All @@ -84,7 +84,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ │ ├── restart node 2 with binary version v23.2.0 (43)
│ │ ├── run "mixed-version 2" (44)
│ │ └── restart node 3 with binary version v23.2.0 (45)
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (46)
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (46)
│ ├── wait for nodes :1-4 to reach cluster version '23.2' (47)
│ └── run "validate upgrade" (48)
└── upgrade cluster from "v23.2.0" to "<current>"
Expand All @@ -111,7 +111,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ ├── run "mixed-version 1" (65)
│ ├── restart node 4 with binary version <current> (66)
│ └── restart node 1 with binary version <current> (67)
├── finalize upgrade by resetting `preserve_downgrade_option` (68)
├── allow upgrade to happen by resetting `preserve_downgrade_option` (68)
├── run "mixed-version 1" (69)
├── wait for nodes :1-4 to reach cluster version <current> (70)
└── run "validate upgrade" (71)
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ mixed-version test plan for upgrading from "v22.1.8" to "v22.2.3" to "v23.1.4" t
│ │ ├── wait for 5m0s (15)
│ │ ├── restart node 4 with binary version v22.2.3 (16)
│ │ └── restart node 2 with binary version v22.2.3 (17)
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (18)
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (18)
│ └── wait for nodes :1-4 to reach cluster version '22.2' (19)
├── run "initialize bank workload" (20)
├── run "bank workload" (21)
Expand All @@ -49,7 +49,7 @@ mixed-version test plan for upgrading from "v22.1.8" to "v22.2.3" to "v23.1.4" t
│ │ ├── restart node 1 with binary version v23.1.4 (25)
│ │ ├── restart node 2 with binary version v23.1.4 (26)
│ │ └── restart node 3 with binary version v23.1.4 (27)
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (28)
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (28)
│ ├── run "mixed-version 1" (29)
│ └── wait for nodes :1-4 to reach cluster version '23.1' (30)
└── upgrade cluster from "v23.1.4" to "<current>"
Expand All @@ -71,6 +71,6 @@ mixed-version test plan for upgrading from "v22.1.8" to "v22.2.3" to "v23.1.4" t
│ ├── restart node 4 with binary version <current> (43)
│ ├── run "mixed-version 1" (44)
│ └── restart node 2 with binary version <current> (45)
├── finalize upgrade by resetting `preserve_downgrade_option` (46)
├── allow upgrade to happen by resetting `preserve_downgrade_option` (46)
├── run "mixed-version 1" (47)
└── wait for nodes :1-4 to reach cluster version <current> (48)
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ mixed-version test plan for upgrading from "v22.2.8" to "<current>" with mutator
│ │ └── testSingleStep, after 30s delay (20) [stage=last-upgrade]
│ ├── restart node 1 with binary version <current> (21) [stage=last-upgrade]
│ └── restart node 3 with binary version <current> (22) [stage=last-upgrade]
├── finalize upgrade by resetting `preserve_downgrade_option` (23) [stage=running-upgrade-migrations]
├── allow upgrade to happen by resetting `preserve_downgrade_option` (23) [stage=running-upgrade-migrations]
└── wait for nodes :1-4 to reach cluster version <current> (24) [stage=running-upgrade-migrations]
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ │ ├── wait for 5m0s (15) [stage=last-upgrade]
│ │ ├── restart node 4 with binary version v22.1.8 (16) [stage=last-upgrade]
│ │ └── restart node 2 with binary version v22.1.8 (17) [stage=last-upgrade]
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (18) [stage=running-upgrade-migrations]
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (18) [stage=running-upgrade-migrations]
│ └── wait for nodes :1-4 to reach cluster version '22.1' (19) [stage=running-upgrade-migrations]
├── upgrade cluster from "v22.1.8" to "v22.2.3"
│ ├── prevent auto-upgrades by setting `preserve_downgrade_option` (20) [stage=init]
Expand All @@ -59,7 +59,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ │ ├── restart node 1 with binary version v22.2.3 (23) [stage=last-upgrade]
│ │ ├── restart node 2 with binary version v22.2.3 (24) [stage=last-upgrade]
│ │ └── restart node 3 with binary version v22.2.3 (25) [stage=last-upgrade]
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (26) [stage=running-upgrade-migrations]
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (26) [stage=running-upgrade-migrations]
│ └── wait for nodes :1-4 to reach cluster version '22.2' (27) [stage=running-upgrade-migrations]
├── run "initialize bank workload" (28) [stage=on-startup]
├── start background hooks concurrently
Expand All @@ -74,7 +74,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ │ ├── run "mixed-version 1" (35) [stage=last-upgrade]
│ │ ├── restart node 4 with binary version v23.1.4 (36) [stage=last-upgrade]
│ │ └── run "mixed-version 2" (37) [stage=last-upgrade]
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (38) [stage=running-upgrade-migrations]
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (38) [stage=running-upgrade-migrations]
│ ├── run "mixed-version 1" (39) [stage=running-upgrade-migrations]
│ ├── wait for nodes :1-4 to reach cluster version '23.1' (40) [stage=running-upgrade-migrations]
│ └── run "validate upgrade" (41) [stage=after-upgrade-finished]
Expand All @@ -101,7 +101,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ │ ├── restart node 1 with binary version v23.2.0 (58) [stage=last-upgrade]
│ │ ├── run "mixed-version 1" (59) [stage=last-upgrade]
│ │ └── restart node 4 with binary version v23.2.0 (60) [stage=last-upgrade]
│ ├── finalize upgrade by resetting `preserve_downgrade_option` (61) [stage=running-upgrade-migrations]
│ ├── allow upgrade to happen by resetting `preserve_downgrade_option` (61) [stage=running-upgrade-migrations]
│ ├── wait for nodes :1-4 to reach cluster version '23.2' (62) [stage=running-upgrade-migrations]
│ └── run "validate upgrade" (63) [stage=after-upgrade-finished]
└── upgrade cluster from "v23.2.0" to "<current>"
Expand All @@ -127,7 +127,7 @@ mixed-version test plan for upgrading from "v21.2.11" to "v22.1.8" to "v22.2.3"
│ ├── restart node 1 with binary version <current> (80) [stage=last-upgrade]
│ ├── restart node 2 with binary version <current> (81) [stage=last-upgrade]
│ └── run "mixed-version 1" (82) [stage=last-upgrade]
├── finalize upgrade by resetting `preserve_downgrade_option` (83) [stage=running-upgrade-migrations]
├── allow upgrade to happen by resetting `preserve_downgrade_option` (83) [stage=running-upgrade-migrations]
├── run "mixed-version 2" (84) [stage=running-upgrade-migrations]
├── wait for nodes :1-4 to reach cluster version <current> (85) [stage=running-upgrade-migrations]
└── run "validate upgrade" (86) [stage=after-upgrade-finished]

0 comments on commit 9647c54

Please sign in to comment.