Comment 14 for bug 1654116

Revision history for this message
John A Meinel (jameinel) wrote :

The actual promise from Juju is that from the time you call 'is-leader' and get a True value, that you will have 30s before we would possibly return True to any other unit.

Internally the mechanism is that we obtain a lease (valid for 1 minute) and attempt to renew that lease every 30s (so the very latest time you could call is-leader is with 31s left, if we failed to renew the leadership token).

Is it possible that there is a gap from when you call "is-leader" until you actually do "leader-set" that is longer than 30s? I'm wondering if you're running into load issues causing us to fail to renew the leadership during normal operation.

We do persist who has leadership in the database, which means it should be stable across the API server restarting, etc. I haven't heard of a case where 'is-leader' can return true but leader-set would then immediately fail, but I can imagine that load could play a factor.