Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.25] state: restart leadership worker if it fails #8046

Merged
merged 1 commit into from
Nov 10, 2017

Conversation

axw
Copy link
Contributor

@axw axw commented Nov 10, 2017

Description of change

Run the leadership manager in a worker.Runner,
restarting it if it fails. The methods on State
for returning leadership claimers and checkers
defer obtaining the current worker until the
claim/check methods are invoked, to avoid
pinning to broken workers.

QA steps

  1. juju bootstrap --upload-tools (I used manual provider, doesn't matter though)
  2. juju deploy ubuntu
  3. juju add-unit ubuntu --to 1
    (wait)
  4. juju ssh 0 "sudo mkdir /var/lib/juju/wrench && echo refresh | sudo tee /var/lib/juju/wrench/lease"
    (observe leadership manager failures in log)
  5. juju ssh 0 "sudo rm /var/lib/juju/wrench/lease"
    (observe some time later that the leadership manager is restarted)

Documentation changes

None.

Bug reference

https://bugs.launchpad.net/juju-core/+bug/1729930

Run the leadership manager in a worker.Runner,
restarting it if it fails. The methods on State
for returning leadership claimers and checkers
defer obtaining the current worker until the
claim/check methods are invoked, to avoid
pinning to broken workers.
@axw
Copy link
Contributor Author

axw commented Nov 10, 2017

@axw
Copy link
Contributor Author

axw commented Nov 10, 2017

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Nov 10, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit 180c675 into juju:1.25 Nov 10, 2017
@@ -177,6 +178,9 @@ func (client *client) ExpireLease(name string) error {
// Refresh is part of the Client interface.
func (client *client) Refresh() error {
client.logger.Tracef("refreshing")
if wrench.IsActive("lease", "refresh") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leads to a lot of DEBUG level complaints about wrench directory not existing.
Is it worth the effort to add it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth the effort to add what? We can remove it, but it seems to me the right thing to do is change wrench to use the TRACE level.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @axw on that point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@axw care to do a simple follow up branch that moves the wrench package Debug statements to Trace?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, will do today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants