-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: Correct the order of generating default and overridden broker capacities in Capacity.processCapacityEntries #10509
Conversation
…pacities in Capacity.processCapacityEntries Signed-off-by: Tian Lu <[email protected]>
ce58214
to
f1fe805
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I left one nit. But I think it looks good otherwise.
// Override default capacities | ||
if (brokerCapacity != null) { | ||
// For checking for duplicate brokerIds | ||
Set<Integer> overrideIds = new HashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this was wrong already before. But maybe you can initialize this only later before the for loop on line 387? That way we won't do an unnecessary initialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @Xander-run, thanks for the fix!
The unit test failures appear to be unrelated to the code changes, could you try running the flagged tests locally to confirm?
I'm not quite sure what you mean by "flagged tests". Is it the CruiseControl group of the system test? |
@Xander-run There was a flaky test that failed originally. But I restarted the tests and it passed. You can just ignore it. |
Signed-off-by: Tian Lu <[email protected]>
50358ff
to
857c9b9
Compare
/azp run regression |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the PR!
Type of change
Description
Correct the order of generating default and overridden broker capacities in Capacity.processCapacityEntries. The order after the change will be:
spec.cruiseControl.brokerCapacity
.spec.cruiseControl.brokerCapacity.overrides
.This reduces the unneeded loop when generating broker capacity configurations and will resolve issue #10465
Checklist
I ran and passed test class
io.strimzi.operator.cluster.model.CruiseControlTest
for this change.