r196 upgraded charmhelpers and broke metadata sync for envs with leader election
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-repository-cache (Juju Charms Collection) |
Fix Released
|
Critical
|
Dan Watkins |
Bug Description
The upgade of charmhelpers in r196[1] broke leadership election and metadata sync for juju environments where leader election is present.
This is a test escape as juju leader election could choose the lowest numbered unit and mask this problem.
charmhelpers.
Presently there could be timing issues for unit start that affect initial unit leadership so that the lowest numbered unit wouldn't be the leader but certainly when a unit is removed and added things will break.
With the introduction of leader election there are new hooks for leadership changes which we would use to determine who runs cron / metadata update. The trick will be running in environments with and without leadership election and testing both. <moderately difficult> OTOH, if leadership election is in the stable release of Juju now, we could just require that.
Also, this sort of transition seems like the sort of thing that charmhelpers was designed to smooth over but doesn't. core.hookenv returns NotImplementedError when leader election and settings aren't available, so it does little for us.
Suggested actions:
1) Triage by changing back to lowest numbered unit for our determination of is_leader
- Replace our current call to charmhelpers.
2) Fix root cause by updating the charm to user juju leadership throughout with hooks to handle leadership changes
[1] http://
Related branches
- Charles Butler (community): Approve
- Robert C Jennings (community): Approve
-
Diff: 73 lines (+18/-5)3 files modifiedlib/ubuntu_repository_cache/mirror.py (+1/-1)
lib/ubuntu_repository_cache/service.py (+2/-3)
lib/ubuntu_repository_cache/util.py (+15/-1)
description: | updated |
description: | updated |
Changed in ubuntu-repository-cache (Juju Charms Collection): | |
status: | Confirmed → Fix Released |
As a note for later when we enable juju leadership election, mirror. _leader_ update_ metadata( ) and mirror. _nonleader_ update_ metadata( ) will need updates to how they determine the leader unit id as it is currently using the lowest active host.