9
9
10
10
11
11
from materialize .checks .actions import Action , Initialize , Manipulate , Sleep , Validate
12
+ from materialize .checks .all_checks .password_auth import PasswordAuth
12
13
from materialize .checks .checks import Check
13
14
from materialize .checks .executors import Executor
14
15
from materialize .checks .features import Features
@@ -541,16 +542,18 @@ def base_version(self) -> MzVersion:
541
542
def actions (self ) -> list [Action ]:
542
543
print (f"Upgrading from tag { self .base_version ()} " )
543
544
544
- def upgrade_actions (version : MzVersion | None ) -> list [Action ]:
545
+ def upgrade_actions (version : MzVersion | None , generation : int ) -> list [Action ]:
546
+ service_name = f"mz_{ generation } "
545
547
return [
546
- KillMz (
547
- capture_logs = True
548
- ), # We always use True here otherwise docker-compose will lose the pre-upgrade logs
549
- StartMz (
548
+ start_mz_read_only (
550
549
self ,
551
550
tag = version ,
551
+ deploy_generation = generation ,
552
+ mz_service = service_name ,
552
553
),
553
- Validate (self ),
554
+ WaitReadyMz (service_name ),
555
+ PromoteMz (service_name ),
556
+ Validate (self , mz_service = service_name ),
554
557
]
555
558
556
559
actions = [
@@ -563,7 +566,7 @@ def upgrade_actions(version: MzVersion | None) -> list[Action]:
563
566
Manipulate (self , phase = 2 ),
564
567
]
565
568
566
- for version in self .v25_2_versions [1 :] + [None ]:
567
- actions .extend (upgrade_actions (version ))
569
+ for ( generation , version ) in enumerate ( self .v25_2_versions [1 :] + [None ]) :
570
+ actions .extend (upgrade_actions (version , generation + 1 ))
568
571
569
572
return actions
0 commit comments