@@ -134,7 +134,7 @@ def wait_until_mysql_connection(self) -> None:
134
134
# Increment this major API version when introducing breaking changes
135
135
LIBAPI = 0
136
136
137
- LIBPATCH = 75
137
+ LIBPATCH = 77
138
138
139
139
UNIT_TEARDOWN_LOCKNAME = "unit-teardown"
140
140
UNIT_ADD_LOCKNAME = "unit-add"
@@ -2311,7 +2311,7 @@ def verify_server_upgradable(self, instance: Optional[str] = None) -> None:
2311
2311
"try:" ,
2312
2312
" util.check_for_server_upgrade(options={'outputFormat': 'JSON'})" ,
2313
2313
"except ValueError:" , # ValueError is raised for same version check
2314
- " if session.run_sql('select @@version').fetch_all()[0][0].split('-')[0] == shell.version.split()[1] :" ,
2314
+ " if session.run_sql('select @@version').fetch_all()[0][0].split('-')[0] in shell.version:" ,
2315
2315
" print('SAME_VERSION')" ,
2316
2316
" else:" ,
2317
2317
" raise" ,
@@ -2471,9 +2471,22 @@ def stop_group_replication(self) -> None:
2471
2471
" session.run_sql('STOP GROUP_REPLICATION')" ,
2472
2472
)
2473
2473
try :
2474
+ logger .debug ("Stopping Group Replication for unit" )
2474
2475
self ._run_mysqlsh_script ("\n " .join (stop_gr_command ))
2475
2476
except MySQLClientError :
2476
- logger .debug ("Failed to stop Group Replication for unit" )
2477
+ logger .warning ("Failed to stop Group Replication for unit" )
2478
+
2479
+ def start_group_replication (self ) -> None :
2480
+ """Start Group replication on the instance."""
2481
+ start_gr_command = (
2482
+ f"shell.connect('{ self .instance_def (self .server_config_user )} ')" ,
2483
+ "session.run_sql('START GROUP_REPLICATION')" ,
2484
+ )
2485
+ try :
2486
+ logger .debug ("Starting Group Replication for unit" )
2487
+ self ._run_mysqlsh_script ("\n " .join (start_gr_command ))
2488
+ except MySQLClientError :
2489
+ logger .warning ("Failed to start Group Replication for unit" )
2477
2490
2478
2491
def reboot_from_complete_outage (self ) -> None :
2479
2492
"""Wrapper for reboot_cluster_from_complete_outage command."""
0 commit comments