Avoid updating connector status again and again when Connect is scaled to 0 #9945
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of change
Description
When Kafka Connect is scaled to 0, we keep updating the status of its connectors again and again. This is because a different status is set by the
KafkaConnect
reconciliation based on the time and by theKafkaConnector
watch. So the timer updates the connector status, that triggers the watch which updates it again. And next periodic reconciliation, the same repeats.This PR updates the status update method used to set the zero replicas status in the connector watch to set the same status as the periodical reconciliation does and that way, the status is updated only once. It also removed the default empty list for the used topics and uses null instead when we actually cannot get the real list of topics.
Checklist