Skip to content

Commit

Permalink
[DPE-4573] Update MySQL to v8.0.39 (#488)
Browse files Browse the repository at this point in the history
* Update MySQL to v8.0.39

* Tentatively pull in updated mysql charm lib to fix failing upgrade tests
  • Loading branch information
shayancanonical authored Nov 27, 2024
1 parent 48a785b commit cf0d7f9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
19 changes: 16 additions & 3 deletions lib/charms/mysql/v0/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def wait_until_mysql_connection(self) -> None:
# Increment this major API version when introducing breaking changes
LIBAPI = 0

LIBPATCH = 75
LIBPATCH = 77

UNIT_TEARDOWN_LOCKNAME = "unit-teardown"
UNIT_ADD_LOCKNAME = "unit-add"
Expand Down Expand Up @@ -2311,7 +2311,7 @@ def verify_server_upgradable(self, instance: Optional[str] = None) -> None:
"try:",
" util.check_for_server_upgrade(options={'outputFormat': 'JSON'})",
"except ValueError:", # ValueError is raised for same version check
" if session.run_sql('select @@version').fetch_all()[0][0].split('-')[0] == shell.version.split()[1]:",
" if session.run_sql('select @@version').fetch_all()[0][0].split('-')[0] in shell.version:",
" print('SAME_VERSION')",
" else:",
" raise",
Expand Down Expand Up @@ -2471,9 +2471,22 @@ def stop_group_replication(self) -> None:
" session.run_sql('STOP GROUP_REPLICATION')",
)
try:
logger.debug("Stopping Group Replication for unit")
self._run_mysqlsh_script("\n".join(stop_gr_command))
except MySQLClientError:
logger.debug("Failed to stop Group Replication for unit")
logger.warning("Failed to stop Group Replication for unit")

def start_group_replication(self) -> None:
"""Start Group replication on the instance."""
start_gr_command = (
f"shell.connect('{self.instance_def(self.server_config_user)}')",
"session.run_sql('START GROUP_REPLICATION')",
)
try:
logger.debug("Starting Group Replication for unit")
self._run_mysqlsh_script("\n".join(start_gr_command))
except MySQLClientError:
logger.warning("Failed to start Group Replication for unit")

def reboot_from_complete_outage(self) -> None:
"""Wrapper for reboot_cluster_from_complete_outage command."""
Expand Down
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resources:
mysql-image:
type: oci-image
description: Ubuntu LTS Docker image for MySQL
upstream-source: ghcr.io/canonical/charmed-mysql@sha256:704af773157fa6c36e5123cf04cac5375971c691b1411ab76cded596e8131dd3
upstream-source: ghcr.io/canonical/charmed-mysql@sha256:aa4d9b21673d2c6e4db3dc943179bae95dd8d355790b68e4e0610da9513ee6c9

peers:
database-peers:
Expand Down
2 changes: 1 addition & 1 deletion src/dependency.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"dependencies": {},
"name": "charmed-mysql",
"upgrade_supported": ">8.0.31",
"version": "8.0.37"
"version": "8.0.39"
}
}

0 comments on commit cf0d7f9

Please sign in to comment.