BIGTOP-2476 Add Zookeeper Charm #15
Conversation
Based on the vanilla apache-zookeeper charm, but utlizes Bigtop to reduce complexity in the charm itself.
I have a couple issues with the status reporting
Followed by setting the appropriate message if we had a suboptimal quantity of peers: https://github.com/juju-solutions/layer-apache-zookeeper/blob/master/reactive/zookeeper.py#L44 If you brought this back, you could add a reactive handler like this:
|
This matches convention, per @kwmonroe
Fixed the status messages. I think that, with the messaging complexity we've introduced by not doing automatic restarts, I'd rather skip the notifications about inadequate numbers for quorum for now. When we add the automated restarts back in, though, I like the idea of adding those messages back in as well. |
This is a port of functionality from the pre Bigtop charm.
@kwmonroe I lied about the messing being too complex. Functionality from the old charm ported over. :-) |
Leaves off the plural.
|
||
def main(): | ||
LOG("starting restart handler main.") | ||
hookenv.status_set('waiting', 'Restarting ...') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lc ftw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it should be maintenance
instead of waiting
.
Ready -> ready
Fixes headaches with writing files out to disk, and is more in line w/ best practices.
LOG("starting restart handler main.") | ||
hookenv.status_set('waiting', 'Restarting ...') | ||
zookeeper = Zookeeper() | ||
zookeeper.install() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be predicated on the zookeeper.started
state and should action_fail
if it's not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnsca Done.
We strip off our own node when running data_changed, which prevents a false positive on first run. We handle the case where a node is restarting when we are checking for leadershp a bit more gracefully.
"even number is" -> "an even number is"
Per comments in PR.
Fits better with what the states are meant for. Also snuck in one more uppercase -> lowercase fix.
Run smoke tests. | ||
''' | ||
for unit in self.d.sentry['zookeeper']: | ||
unit.action_do("smoke-test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no smoke-test action in this charm.. this isn't necessarily a bad thing since it will just pick up the default smoke-test from here:
https://github.com/juju-solutions/layer-apache-bigtop-base/blob/master/actions/smoke-test
just wanted to make sure you knew this would happen, and that there was no custom smoke-test handling required for zk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kwmonroe Yep. The default smoke test action is just fine for Zookeeper -- we don't need to do any special setup.
I've opened a PR upstream, so closing out this PR. |
Based on the vanilla apache-zookeeper charm, but utlizes Bigtop to
reduce complexity in the charm itself.
@juju-solutions/bigdata: Since I'm still a newb, I'm pushing one more PR w/ the team before submitting upstream. This, I think, is the final, actually working, following all the best practices version of this charm. If you agree, please +1. If I missed something, please let me know, and I'll fix it :-)