Skip to content

Commit cf0d7f9

Browse files
[DPE-4573] Update MySQL to v8.0.39 (#488)
* Update MySQL to v8.0.39 * Tentatively pull in updated mysql charm lib to fix failing upgrade tests
1 parent 48a785b commit cf0d7f9

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

lib/charms/mysql/v0/mysql.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def wait_until_mysql_connection(self) -> None:
134134
# Increment this major API version when introducing breaking changes
135135
LIBAPI = 0
136136

137-
LIBPATCH = 75
137+
LIBPATCH = 77
138138

139139
UNIT_TEARDOWN_LOCKNAME = "unit-teardown"
140140
UNIT_ADD_LOCKNAME = "unit-add"
@@ -2311,7 +2311,7 @@ def verify_server_upgradable(self, instance: Optional[str] = None) -> None:
23112311
"try:",
23122312
" util.check_for_server_upgrade(options={'outputFormat': 'JSON'})",
23132313
"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:",
23152315
" print('SAME_VERSION')",
23162316
" else:",
23172317
" raise",
@@ -2471,9 +2471,22 @@ def stop_group_replication(self) -> None:
24712471
" session.run_sql('STOP GROUP_REPLICATION')",
24722472
)
24732473
try:
2474+
logger.debug("Stopping Group Replication for unit")
24742475
self._run_mysqlsh_script("\n".join(stop_gr_command))
24752476
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")
24772490

24782491
def reboot_from_complete_outage(self) -> None:
24792492
"""Wrapper for reboot_cluster_from_complete_outage command."""

metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ resources:
3232
mysql-image:
3333
type: oci-image
3434
description: Ubuntu LTS Docker image for MySQL
35-
upstream-source: ghcr.io/canonical/charmed-mysql@sha256:704af773157fa6c36e5123cf04cac5375971c691b1411ab76cded596e8131dd3
35+
upstream-source: ghcr.io/canonical/charmed-mysql@sha256:aa4d9b21673d2c6e4db3dc943179bae95dd8d355790b68e4e0610da9513ee6c9
3636

3737
peers:
3838
database-peers:

src/dependency.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"dependencies": {},
1010
"name": "charmed-mysql",
1111
"upgrade_supported": ">8.0.31",
12-
"version": "8.0.37"
12+
"version": "8.0.39"
1313
}
1414
}

0 commit comments

Comments
 (0)