Skip to content

Commit 3491c74

Browse files
[DPE-7648] Fix access to not populated instance label (#629)
1 parent bda0b6b commit 3491c74

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/charms/mysql/v0/mysql.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def wait_until_mysql_connection(self) -> None:
133133
# Increment this major API version when introducing breaking changes
134134
LIBAPI = 0
135135

136-
LIBPATCH = 88
136+
LIBPATCH = 89
137137

138138
UNIT_TEARDOWN_LOCKNAME = "unit-teardown"
139139
UNIT_ADD_LOCKNAME = "unit-add"
@@ -795,6 +795,11 @@ def get_cluster_endpoints(self, relation_name: str) -> Tuple[str, str, str]:
795795
rw_endpoints = set()
796796

797797
for k, v in repl_topology.items():
798+
# When a replica instance is catching up with the primary instance,
799+
# the custom label assigned by the operator code has not yet been applied.
800+
if v["status"] == MySQLMemberState.RECOVERING:
801+
continue
802+
798803
address = f"{self.get_unit_address(unit_labels[k], relation_name)}:3306"
799804

800805
if v["status"] != MySQLMemberState.ONLINE:

0 commit comments

Comments
 (0)