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

Check assigned partition-replicas when changing node roles #9608

Merged

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented Jan 29, 2024

Type of change

  • Enhancement / new feature

Description

This PR extends the scale-down check to also prevent removing the broker role from mixed nodes in Kraft when they still have any assigned partition replicas.

To do this, it refactors the PreventBrokerScaleDownCheck to not check directly if the broker IDs being scaled-down are in use. It now returns the list of brokers in use and the check is done in the KafkaClusterCreator class where it is used for both the scale-down check as well as for the broker-role-removal check. It also renames this class to BrokersInUseCheck to better correspond to the new role and improves the unit tests.

Documentation will be updated in a separate PR.

This should resolve #9436.

Checklist

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md

@scholzj scholzj added this to the 0.40.0 milestone Jan 29, 2024
@scholzj
Copy link
Member Author

scholzj commented Jan 29, 2024

/azp run kraft-regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj
Copy link
Member Author

scholzj commented Jan 29, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Jakub Scholz <www@scholzj.com>
Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj scholzj force-pushed the check-assigned-replicas-when-changing-roles branch from 57e22f8 to 6a371b8 Compare January 31, 2024 13:14
@scholzj scholzj merged commit 9d7b1a6 into strimzi:main Jan 31, 2024
13 checks passed
@scholzj scholzj deleted the check-assigned-replicas-when-changing-roles branch April 23, 2024 19:20
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.

[KRaft] Prevent mixed nodes changing to controller-only nodes if they still have assigned partition replicas
2 participants