You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: Kazoo appears to be supplying "from_config"/"config_version" incorrectly in the reconfig command.
Expected Behavior
get('/zookeeper/config') yields a config with a version.
reconfig(joining"some hosts", leaving=None, new_hosts=None, from_config=version), where version is the version from step 1, works correctly.
If reconfig fails with BadVersionError, any subsequent get('/zookeeper/config') calls should return a different version.
However, if I do echo 'reconfig -v THE_VERSION -add SOME_HOSTS | zkCli.sh, the reconfiguration succeeds, with the same version string as above.
Actual Behavior
get('/zookeeper/config') yields a config with a version.
reconfig(joining"some hosts", leaving=None, new_hosts=None, from_config=version), always returns BadVersionError whenever from_config is supplied. Only omitting from_config allows reconfiguration to succeed.
After getting a BadVersionError, subsequent get('/zookeeper/config') return the same version as returned in step 1.
Additionally, the int type assertion for from_config seems incorrect, as config is a zxid type (documented here), meaning that values like 1000000d5 are valid.
Suspected Root Cause
I think that Kazoo is incorrectly serializing the from_config value as an int instead of a zxid, though I'm not quite sure how to serialize it correctly.
An erroneous type assertion is here, and erroneous serialization code is here.
However, removing the type assertion and changing the serialization code to write_string did not resolve the problem for me; I was able to supply a str to client.reconfig without failing the type assertion, but still received a BadVersionError.
Snippet to Reproduce the Problem
def parse_zk_config(raw):
for line in raw.splitlines():
line = line.strip()
if line.startswith('version'):
return line.split('=', 1)[-1]
c = KazooClient()
c.start()
version = parse_zk_config(c.get('/zookeeper/config')[0])
version = int(version) # Fails unless ZK version happens to be an int-castable value
c.reconfig(joining='server.3=22.0.46.63:2182:2183:participant;2181', leaving=None, new_members=None, config_id=version)
That snippet always fails for me (BadVersionError on last line). No other reconfigurations occur with my test ensemble, so there's not a race (i.e. the BadVersionError). Subsequent calls to c.get('/zookeeper/config') confirm that the version isn't changing.
Furthermore, the following command succeeds (assuming an initial version value of 100000000):
Summary: Kazoo appears to be supplying "from_config"/"config_version" incorrectly in the
reconfig
command.Expected Behavior
get('/zookeeper/config')
yields a config with a version.reconfig(joining"some hosts", leaving=None, new_hosts=None, from_config=version)
, whereversion
is the version from step 1, works correctly.reconfig
fails withBadVersionError
, any subsequentget('/zookeeper/config')
calls should return a different version.echo 'reconfig -v THE_VERSION -add SOME_HOSTS | zkCli.sh
, the reconfiguration succeeds, with the same version string as above.Actual Behavior
get('/zookeeper/config')
yields a config with a version.reconfig(joining"some hosts", leaving=None, new_hosts=None, from_config=version)
, always returns BadVersionError wheneverfrom_config
is supplied. Only omittingfrom_config
allows reconfiguration to succeed.get('/zookeeper/config')
return the same version as returned in step 1.Additionally, the
int
type assertion for from_config seems incorrect, as config is azxid
type (documented here), meaning that values like1000000d5
are valid.Suspected Root Cause
I think that Kazoo is incorrectly serializing the from_config value as an
int
instead of azxid
, though I'm not quite sure how to serialize it correctly.An erroneous type assertion is here, and erroneous serialization code is here.
However, removing the type assertion and changing the serialization code to
write_string
did not resolve the problem for me; I was able to supply astr
toclient.reconfig
without failing the type assertion, but still received a BadVersionError.Snippet to Reproduce the Problem
That snippet always fails for me (BadVersionError on last line). No other reconfigurations occur with my test ensemble, so there's not a race (i.e. the BadVersionError). Subsequent calls to
c.get('/zookeeper/config')
confirm that the version isn't changing.Furthermore, the following command succeeds (assuming an initial version value of 100000000):
Logs with logging in DEBUG mode
Specifications
pip list
command:3.6.2--803c7f1a12f85978cb049af5e4ef23bd8b688715, built on 09/04/2020 12:44 GMT
The text was updated successfully, but these errors were encountered: