Clear configured and clustered flags for removed instances
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL InnoDB Cluster Charm |
Fix Released
|
High
|
David Ames |
Bug Description
When an instance is removed from the cluster either by departing gracefully due to a juju remove-unit or when running the remove-instance action the cluster-
juju run --unit mysql-innodb-
cluster-created: 75e3655d-
cluster-
cluster-
cluster-
cluster-
cluster-
cluster-
cluster-
cluster-
cluster-
cluster-
In the above example 10.5.0.48 had been removed but the flags remained.
The problem arises when a new instance is created and it accidentally gets the same IP address (10.5.0.48 in the example). This will lead to the new instance (with the same IP address) never properly joining the cluster and stuck in the following state. See test artifacts from [0].
blocked Cluster is inaccessible from this instance. Please check logs for details.
The workaround is to clear the flags:
(in debug hooks or from juju run)
charms.reactive clear_flag cluster-
charms.reactive clear_flag cluster-
Changed in charm-mysql-innodb-cluster: | |
assignee: | nobody → David Ames (thedac) |
importance: | Undecided → High |
status: | New → Triaged |
Changed in charm-mysql-innodb-cluster: | |
milestone: | none → 21.04 |
status: | Fix Committed → Fix Released |
Secondary issue:
It turned out clearing the flag turned out to be more difficult than anticipated. After much trial and error figured out that the issue is leader set with a key with dots in it.
You should be able to do the following:
# leader-set key=value
# leader-get
key=value
# leader-set key=
# leader-get
{}
However when a dot is in the key name this does not work:
# leader-set cluster- instance- clustered- 10.5.0. 10= dots="True" instance- clustered- 10.5.0. 10: "True"
# leader-set key.with.
# leader-get
cluster-
key.with.dots: "True"
# leader-set key.with.dots= instance- clustered- 10.5.0. 10: "True"
# leader-get
cluster-
cluster-with.dots: "True"
TRIAGE:
Change flags from IP address to IP separated by dashes:
leadership. leader_ set({
"cluster- instance- clustered- {}"
.format( self.cluster_ address. replace( ".", "-")): True})
The next step is to translate this into the leader layer settings.
The remove-instance action should clear flags and bonus points for having the leader remove instance when in a departing hook.