Excessive calls to set_zookeeper_active()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-k8s-zookeeper |
New
|
Undecided
|
David |
Bug Description
This is the current code in reactive/
@when('
def set_zookeeper_
"""Set zookeeper status active
Conditions:
- zookeeper-
"""
layer.
The problem is that the 'zookeeper-
This has unintended side-effects, such as overwriting the state when other actions are occurring, such as sending config during relation handling.
I would suggest the following changes:
Set the 'zookeeper-
@when('
@when_not(
def set_zookeeper_
"""Set zookeeper status active
Conditions:
- zookeeper-
"""
layer.
set_
Second, instead of checking if the configured flag is set for send_config(), check the active flag. When the relation is joined, call set_zookeeper_
@when('
def send_config():
[..]
This will make sure that a) we're resetting the state after it's been put into maintenance mode earlier in send_config().
Changed in charm-k8s-zookeeper: | |
assignee: | nobody → David (davigar15) |