config-changed breaks configuration in Kafka
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Juju Charms Collection |
In Progress
|
Undecided
|
Unassigned |
Bug Description
In the Kafka charm / utils.py the following block matches the config-changed hook:
def update_
with open(path) as fh:
config = []
for l in fh.readlines():
if l.startswith(
elif l.startswith(
# If no change just exit
if l.split('=', 1) == zks:
with open(path, 'w') as fh:
return True
We see that if the line starts with "zookeeper.connect" then it will be replaced by the list of ZooKeeper servers. Unfortunately there are 2 lines that start with zookeeper.connect.
#######
# Zookeeper connection string (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
# server. e.g. "127.0.
# You can also append an optional chroot string to the urls to specify the
# root directory for all kafka znodes.
# zookeeper.
zookeeper.
# Timeout in ms for connecting to zookeeper
zookeeper.
As a consequence, applying config-changed will update that into:
#######
# Zookeeper connection string (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
# server. e.g. "127.0.
# You can also append an optional chroot string to the urls to specify the
# root directory for all kafka znodes.
zookeeper.
# Timeout in ms for connecting to zookeeper
zookeeper.
This is not desirable, as the timeout may actually be useful to debug a bad network state or kill nodes automagically on relation-broken / departed.
A better match for the line would be
def update_
with open(path) as fh:
config = []
for l in fh.readlines():
if l.startswith(
elif l.startswith(
# If no change just exit
if l.split('=', 1) == zks:
with open(path, 'w') as fh:
return True
Related branches
Changed in charms: | |
status: | New → In Progress |
tags: | added: not-a-charm |