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

Fix: intra.broker.goals cannot be configured as default.goals #2221

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

k0b3rIT
Copy link

@k0b3rIT k0b3rIT commented Nov 8, 2024

Summary

  1. Why: KafkaCruiseControlConfig sanity checks prevent to configure inter broker goals as default goals.
  2. What: Modify the sanity check to allow adding intra broker goals to the default.goals

Expected Behavior

I can add (enable) goals to the default.goals list from both the intra and inter broker goals
image

Actual Behavior

Sanity checks ensure the following rules:

  • goals and intra broker goals should be disjoint (an intra broker goal cant be in the goals and the intra.broker.goals at the same time)
  • default.goals should be a subset of goals (As a result of this, we could not add intra broker goal to the default.goals)
  • intra.broker.goals cant be empty (you could not move all the intra broker roles to the goals)
    image

We could not add intra goal to the default.goals without a trick (see in the workaround section)

Steps to Reproduce

Try to enable an intra broker goal by adding it to the default. goals

Known Workarounds

You can remove 1 intra broker goal from the intra.broker.goals config and add that to the goals (keep in mind that the other one should be in the intra.broker.goals as the list cant be empty) this way you can add that 1 goal to the default.goals and enable it

Note that this way we still cant enable both of the currently available intra broker goals as 1 have to be in the intra.broker.goals list to avoid hitting the mentioned sanity check. So only 1 intra goal at a time.

Categorization

  • documentation
  • bugfix
  • new feature
  • refactor
  • security/CVE
  • other

Copy link
Contributor

@viktorsomogyi viktorsomogyi left a comment

Choose a reason for hiding this comment

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

@mhratson would you please review this?

@viktorsomogyi
Copy link
Contributor

@CCisGG would you review this please if you have some time?

@imans777
Copy link

imans777 commented Jan 4, 2025

?

@k0b3rIT
Copy link
Author

k0b3rIT commented Jan 7, 2025

?

Hi @imans777,
Do you have a concern regarding this change?

// Ensure that default goals are supported inter-broker goals.
if (defaultGoalNames.stream().anyMatch(g -> !interBrokerGoalNames.contains(g))) {
// Ensure that default goals are supported inter-broker or intra-broker goals.
if (defaultGoalNames.stream().anyMatch(g -> !interBrokerGoalNames.contains(g) && !intraBrokerGoalNames.contains(g))) {
throw new ConfigException(String.format("Attempt to configure default goals with unsupported goals (%s:%s and %s:%s).",
AnalyzerConfig.DEFAULT_GOALS_CONFIG, defaultGoalNames,
AnalyzerConfig.GOALS_CONFIG, interBrokerGoalNames));
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you also need to update the exception logs to make it more clear.

Copy link
Author

Choose a reason for hiding this comment

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

You are right, I have fixed it!

@CCisGG
Copy link
Contributor

CCisGG commented Jan 7, 2025

To me, allowing intra broker goals to be added into default goals is a valid intention. I'm just trying to make sure this won't break users who don't use intra broker goals. From the code change, looks like it won't.

@k0b3rIT
Copy link
Author

k0b3rIT commented Jan 7, 2025

To me, allowing intra broker goals to be added into default goals is a valid intention. I'm just trying to make sure this won't break users who don't use intra broker goals. From the code change, looks like it won't.

@CCisGG thanks for your feedback.
My understanding is that intra.broker.goals is just a list of supported intra goals, just like the goals is the list of supported inter goals.
There is no other way to enable the intra broker roles, other than adding it to the default goals.

But now it is not possible, just with the mentioned workaround.
So I dont think it will break anyone.

@imans777
Copy link

imans777 commented Jan 8, 2025

?

Hi @imans777, Do you have a concern regarding this change?

Hey there, I just wanted to pop up this change to be reviewed and merged sooner :)

@k0b3rIT
Copy link
Author

k0b3rIT commented Jan 9, 2025

?

Hi @imans777, Do you have a concern regarding this change?

Hey there, I just wanted to pop up this change to be reviewed and merged sooner :)

Ahh, got it, THX!

@k0b3rIT
Copy link
Author

k0b3rIT commented Jan 9, 2025

Thank you for the approval @CCisGG! Do you have write access to merge this PR?

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.

5 participants