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-484] Stop polling external cmr controller when it is removed #13646

Merged
merged 1 commit into from
Jan 24, 2022

Conversation

wallyworld
Copy link
Member

For offers host on a different controller, the consuming side needs to poll the controller to keep up to date with any API address changes. However, we weren't stopping the poll operation when all consuming apps were removed. And if the external controller was killed, the polling would fill the logs with errors.

This PR adds ref counting so that we track if an external controller record is still needed. Once all SAAS applications are removed, the external controller record is also deleted. A watcher in the polling worker causes the worker stop. To enabled the ref counting, the SAAS application gets a new attribute set to the external controller UUID.

An upgrade step is added to set the new external controller UUID attribute on any relevant SAAS applications, and also remove any orphaned external controller records.

In the polling worker, the external controller connection is now done asynchronously to avoid blocking the worker from shutting down if the external controller is removed while the connection is being made. Error handling is also fixed to properly account for not found etc.

Another fix is that getting the api addresses for the external controller was incorrectly including an empty address if there was no public DNS name recorded.

QA steps

bootstrap two earlier 2.9 controllers with logging for juju.worker.externalcontrollerupdater set to DEBUG
create a cross controller relation
upgrade the controllers
use mongo shell to check that the source-countroller-uuid is set for the remote application record on the consuming side
on the consuming side, run juju remove-saas to delete the consuming application
check log for stopping watcher for external controller ...
run juju consume to consume the offer again
check log for starting watcher for external controller ...

Bug reference

https://bugs.launchpad.net/juju/+bug/1958446

@wallyworld
Copy link
Member Author

$$merge$$

1 similar comment
@wallyworld
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit f28c060 into juju:2.9 Jan 24, 2022
@wallyworld wallyworld mentioned this pull request Jan 31, 2022
jujubot added a commit that referenced this pull request Feb 1, 2022
#13673

Merge 2.9

#13546 [JUJU-299] Store unit CharmURL as a string reference
#13640 add message query to juju wait-for
#13646 [JUJU-484] Stop polling external cmr controller when it is removed
#13634 [JUJU-463] Implement NetworkInterfaces method for azure provider
#13624 [JUJU-416] Consistantly use juju/retry to handle retries 3 (state/*)
#13648 [JUJU-464] Implement NetworkInterfaces method for openstack provider
#13636 [JUJU-479] Revert "unit charm url"
#13650 [JUJU-485] Add per controller and per app limits for downloading resources
#13649 [JUJU-481] Remove fake NIC generation fallback logic from instancepoller worker
#13681 Comment out the snap interfaces till approved
#13670 [JUJU-521] 1959351 fix slow juju ssh leader
#13671 [JUJU-527] Updating juju/os to support macos Monterey
#13678 [Juju-541] Document use of the @ symbol when setting a config value in help message

Lots of trivial conflicts due ot import path changes and the forward port of the charm download changes which first landed in this branch and were backported.

## QA steps

See PRs



[JUJU-299]: https://warthogs.atlassian.net/browse/JUJU-299?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-484]: https://warthogs.atlassian.net/browse/JUJU-484?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-463]: https://warthogs.atlassian.net/browse/JUJU-463?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-416]: https://warthogs.atlassian.net/browse/JUJU-416?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-464]: https://warthogs.atlassian.net/browse/JUJU-464?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-479]: https://warthogs.atlassian.net/browse/JUJU-479?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-485]: https://warthogs.atlassian.net/browse/JUJU-485?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-481]: https://warthogs.atlassian.net/browse/JUJU-481?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

[JUJU-521]: https://warthogs.atlassian.net/browse/JUJU-521?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-527]: https://warthogs.atlassian.net/browse/JUJU-527?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants