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

[DPE-2644] Test: network cut #139

Merged
merged 7 commits into from
Oct 6, 2023

Conversation

zmraul
Copy link
Contributor

@zmraul zmraul commented Oct 2, 2023

Adds network cut, which includes an IP change to the unit.

  • Broker won't rejoin the cluster until the next update_status triggers.

@zmraul zmraul changed the base branch from test/high-availability to test/dpe-2370-network-throttle October 2, 2023 11:37
@zmraul zmraul marked this pull request as ready for review October 3, 2023 10:03
src/charm.py Outdated
Comment on lines 207 to 217
# NOTE: integration with kafka-broker-rack-awareness charm.
# Load current properties set in the charm workload and check
# if rack.properties file exists
# if rack.properties file exists.
# Also, check if listeners changed (IP change)
properties = safe_get_file(self.kafka_config.server_properties_filepath)
if properties and (
self.kafka_config.rack_properties != []
(self.kafka_config.rack_properties != [] or not self.kafka_config.listeners_updated)
and (set(self.kafka_config.server_properties) ^ set(properties))
):
self._on_config_changed(event)
self._restart(event)
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Could we move the self._on_config_changed(event) alone to right before the final self._set_status(Status.ACTIVE)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not there, because the machine health check would return earlier. I can move it after broker active.

Copy link
Contributor

@deusebio deusebio left a comment

Choose a reason for hiding this comment

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

Looks good!

@zmraul zmraul merged commit d4c7829 into test/dpe-2370-network-throttle Oct 6, 2023
9 checks passed
@zmraul zmraul deleted the test/dpe-2644-network-cut branch October 6, 2023 16:00
zmraul added a commit that referenced this pull request Oct 6, 2023
* add network throttle test

* [DPE-2644] Test: network cut (#139)

* run _on_config_changed on update_status
deusebio pushed a commit that referenced this pull request Oct 16, 2023
* add network throttle test

* [DPE-2644] Test: network cut (#139)

* run _on_config_changed on update_status
zmraul added a commit that referenced this pull request Oct 17, 2023
* add network throttle test

* [DPE-2644] Test: network cut (#139)

* run _on_config_changed on update_status
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