Skip to content

Commit

Permalink
Fixing behavior when module ignores necessity of topic options update…
Browse files Browse the repository at this point in the history
… for existing topics if topic provided with default values for partitions and/or replica_factor.
  • Loading branch information
Panov Eduard committed Jul 23, 2024
1 parent edf73b0 commit 9b31e10
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions module_utils/kafka_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1499,16 +1499,17 @@ def get_topics_to_update(self, topics):
topic['name']
)
)
topics = [
topic for topic in topics if (
topic['partitions'] > 0 and topic['replica_factor'] > 0)
]
topics_changed.update(
self.is_topics_configuration_need_update({
topic['name']: topic['options'].items()
for topic in topics
})
)

topics = [
topic for topic in topics if (
topic['partitions'] > 0 and topic['replica_factor'] > 0)
]
topics_changed.update(
self.is_topics_replication_need_update({
topic['name']: {
Expand Down Expand Up @@ -1546,10 +1547,6 @@ def ensure_topics(self, topics):
)
)

topics = [
topic for topic in topics if (
topic['partitions'] > 0 and topic['replica_factor'] > 0)
]

topics_config_need_update = self.is_topics_configuration_need_update({
topic['name']: topic['options'].items()
Expand All @@ -1563,6 +1560,10 @@ def ensure_topics(self, topics):
})
topics_changed.update(topics_config_need_update)

topics = [
topic for topic in topics if (
topic['partitions'] > 0 and topic['replica_factor'] > 0)
]
topics_replication_need_update = \
self.is_topics_replication_need_update({
topic['name']: {
Expand Down

0 comments on commit 9b31e10

Please sign in to comment.