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

Fixed autoRebalance status not reset when auto-rebalancing or Cruise Control is not enabled #10652

Merged
merged 4 commits into from
Oct 1, 2024

Conversation

ppatierno
Copy link
Member

Type of change

  • Bugfix

Description

When the cluster starts without Cruise Control enabled or without auto-rebalance configured, the corresponding status is set anyway (which on cluster creation is anyway wrong, because it's not a scaling up operation).
When Cruise Control or auto-rebalance configuration is removed, the status is not reset as well.
For example, you create a Kafka cluster with:

cruiseControl: {}

on creation, the status contains the following:

status:
  autoRebalance:
    modes:
    - brokers:
      - 3
      - 4
      - 5
      mode: add-brokers

It hasn't to be there, because cruiseControl.autoRebalance is not enabled at all and it's even cluster creation not scaling up.
No auto-rebalance runs but the status is anyway wrong.
Another example, you create a Kafka cluster with cruiseControl.autoRebalance configured so the status is:

status:
  autoRebalance:
    lastTransitionTime: "2024-09-28T14:14:45.485639784Z"
    state: Idle

and then you remove the autoRebalance part of it or even the entire cruiseControl section.
The status.autoRebalance should disappear because keeping the info about the "Idle" state doesn't make any sense anymore (auto-rebalance is not configured).

This PR fixes the above issue(s), also improving the way the KafkaAssemblyOperator can make the decision about running or not the auto-rebalacing reconciliation at all. This way some state initialization is also pulled out from the reconcile of the KafkaAutoRebalancingReconciler.

Checklist

  • Write tests
  • Make sure all tests pass
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally

Control is not enabled

Signed-off-by: Paolo Patierno <ppatierno@live.com>
@ppatierno ppatierno added this to the 0.44.0 milestone Sep 29, 2024
@ppatierno ppatierno requested a review from scholzj September 29, 2024 10:58
@ppatierno
Copy link
Member Author

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

time

Signed-off-by: Paolo Patierno <ppatierno@live.com>
Signed-off-by: Paolo Patierno <ppatierno@live.com>
Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

One nit. LGTM otherwise.

Signed-off-by: Paolo Patierno <ppatierno@live.com>
@ppatierno
Copy link
Member Author

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ppatierno ppatierno merged commit 4a53db5 into strimzi:main Oct 1, 2024
21 checks passed
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.

2 participants