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

Improve handling of invalid topic configurations #10517

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

fvaleri
Copy link
Contributor

@fvaleri fvaleri commented Aug 29, 2024

Type of change

Improvement

Description

An invalid topic configuration results in a RuntimeException that fails the whole reconciliation and following periodic reconciliations. Additionally, if you have a batch of 100 topics or more, it can be difficult to spot where the configuration errors is.

With this change the TO reports the error in the status of the Kafka topic containing the invalid configuration, and continues with the reconciliation.

Checklist

  • Write tests
  • Make sure all tests pass

@fvaleri fvaleri requested review from tombentley and scholzj August 29, 2024 11:27
@fvaleri fvaleri added this to the 0.44.0 milestone Aug 29, 2024
@fvaleri fvaleri force-pushed the to-null-config branch 2 times, most recently from b93b1b2 to d294c0f Compare August 29, 2024 12:10
Copy link
Contributor

@tinaselenge tinaselenge left a comment

Choose a reason for hiding this comment

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

LGTM

@fvaleri
Copy link
Contributor Author

fvaleri commented Aug 31, 2024

/packit test --labels regression

@tombentley
Copy link
Member

@fvaleri I pushed a few tweaks to your branch. Could you take a look and let me know if you agree with them, if not we can discuss here. Thanks.

fvaleri and others added 2 commits September 2, 2024 08:11
An invalid topic configuration results in a RuntimeException that fails the whole reconciliation and following periodic reconciliations.
Additionally, if you have a batch of 100 topics or more, it can be difficult to spot where the configuration errors is.

With this change the TO reports the error in the status of the Kafka topic containing the invalid configuration, and continues with the reconciliation.

Signed-off-by: Federico Valeri <[email protected]>
1. Propagate null config value to Kafka as a special case.
   This an an improvement because the TO generally takes the position that validation of configs should be done my Kafka, not the operator, which allows Kafka to change what's considered valid without needing to update the TO.
2. I figured out that we can pass values of other JSON types as well as null, so I added a test for this.
3. For such types configValueAsString() must return a String, but there's no corresponding ConfigDef.Type, so
   configValueAsString() must throw something. But let's use something more specific than RuntimeException.

Signed-off-by: Tom Bentley <[email protected]>
@fvaleri
Copy link
Contributor Author

fvaleri commented Sep 2, 2024

Thanks for the improvement. It looks good, I just did a rebase due to an import conflict. We are good to go now.

Copy link
Member

@tombentley tombentley left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @fvaleri

Signed-off-by: Federico Valeri <[email protected]>
@scholzj
Copy link
Member

scholzj commented Sep 2, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj scholzj merged commit 5e7a711 into strimzi:main Sep 2, 2024
21 checks passed
@fvaleri fvaleri deleted the to-null-config branch September 2, 2024 14:34
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