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

[JUJU-523] Ensure a robust isController wrapper for machine manifolds #13668

Merged
merged 4 commits into from Jan 31, 2022

Conversation

manadart
Copy link
Member

@manadart manadart commented Jan 28, 2022

Some manifolds in the machine dependency engine are wrapped with isController to ensure they only run on controllers. This wrapper in turn has the state worker as a dependency.

Depending on state in this case is problematic, because if the state fails to ping Mongo, all such workers will bounce whether or not they depend on state.

Instead we use the state config watcher, which determines whether we are a controller based on the presence of state serving info. This will remain static when we change the Mongo primary (and bounce the state worker), leaving fewer workers to restart in such an event.

In addition, some redundant usage of isController is removed where it is already implied by other dependencies.

QA steps

  • Bootstrap and juju enable-ha.
  • juju deploy ubuntu.
  • Observe error free operation in the quiesced state.
  • juju ssh 0 and run juju_engine_report.
  • Ensure that controller-only workers are not being run.
  • juju ssh -m controller 0 and run juju_engine_report.
  • Ensure that controller-only workers are being run.
  • Connect to the Mongo primary and run rs.stepDown()
  • Observe the controller and workloads return to an error-free state.

In my simple A/B test, these workers did not bounce for a Mongo primary switch:

  • agent-config-updater
  • certificate-watcher
  • fan-configurer (probably incidental)
  • is-controller-flag
  • model-cache-initialized-flag
  • upgrade-database-flag
  • upgrade-database-gate
  • upgrade-database-runner

Documentation changes

None.

Bug reference

N/A

ifDatabaseUpgradeComplete - it is already implied, and therefore
redundant.
@manadart manadart added the 2.9 label Jan 28, 2022
@manadart manadart changed the title Ensure a robust isController wrapper for machine manifolds [JUJU-523] Ensure a robust isController wrapper for machine manifolds Jan 28, 2022
Copy link
Member

@jameinel jameinel left a comment

Choose a reason for hiding this comment

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

I don't understand the removal of isController but the changes for the flag looks good.

cmd/jujud/agent/machine/manifolds.go Show resolved Hide resolved
cmd/jujud/agent/machine/manifolds.go Show resolved Hide resolved
watcher instead of state.

This means that when a state ping fails, controller-gated workers that
do not depend on state will not bounce.
@manadart
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit ff1a0e9 into juju:2.9 Jan 31, 2022
@manadart manadart deleted the 2.9-robust-iscontroller-flag branch January 31, 2022 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants