You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "nileshkumar3 (via GitHub)" <gi...@apache.org> on 2026/03/01 21:07:52 UTC

[PR] handling 0 partitions [kafka]

nileshkumar3 opened a new pull request, #21609:
URL: https://github.com/apache/kafka/pull/21609

   Summary
   This PR hardens BuiltInPartitioner.partitionForKey(...) against invalid partition counts.
   partitionForKey previously performed % numPartitions directly, which could throw ArithmeticException when numPartitions == 0.
   This change adds explicit input validation and fails fast with a clearer error.
   Changes
   1.
   BuiltInPartitioner.partitionForKey(...) now validates numPartitions > 0.
   2.
   If invalid, it throws:
   ◦
   IllegalArgumentException("numPartitions must be > 0, but was " + numPartitions)
   Tests
   Added direct unit coverage in BuiltInPartitionerTest:
   1.
   testPartitionForKeyReturnsValidPartition
   ◦
   Verifies returned partition is within [0, numPartitions).
   2.
   testPartitionForKeyThrowsIfNumPartitionsNotPositive
   ◦
   Verifies IllegalArgumentException for numPartitions == 0 and -1.
   Executed:
   •
   ./gradlew :clients:test --tests org.apache.kafka.clients.producer.internals.BuiltInPartitionerTest
   All tests passed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-9651: Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #21609: KAFKA-9651: Handle edge case when partition metadata contains zero partitions
URL: https://github.com/apache/kafka/pull/21609


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-3996012751

   @nileshkumar3 , some tests failed. Please take a look. Thanks.
   https://github.com/apache/kafka/actions/runs/22654356593/job/65664401704?pr=21609


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-4025717928

   > @nileshkumar3 But how does the retry work? Suppose my topic metadata is insufficient after a rebalance. What triggers a new rebalance?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 closed pull request #21609: kAFKA-9651:Handle edge case when partition metadata contains zero partitions
URL: https://github.com/apache/kafka/pull/21609


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-4009966961

   \cc @lucasbru for second review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:handling 0 partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-3994889056

   > Note: Although the producer side already has validated the partition size is > 0, the stream side (like [here](https://github.com/apache/kafka/blob/c77a96d13238c3127dc8cf016d437efb5e64bfa9/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.java#L480)) I cannot see all places have the partition size validation. Adding a validation in the partitionFor makes sense to me to avoid missing validation. When we have a fail use case reported, I think we should fix in the root to have re-fetch metadata mechanism or something.
   
   @showuon Added validation in StreamsMetadataState.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-4028575440

   @lucasbru I updated the change to use store/topic-scoped filtering instead of skipping the metadata rebuild entirely. When some source topics are missing partition metadata, we log that and continue rebuilding metadata for stores whose source topics are present. This avoids rebuilding StreamsMetadataState with incomplete metadata (the KAFKA-9651 failure mode) while still allowing unrelated stores to refresh their metadata.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-4054800644

   > @lucasbru I updated the change to use store/topic-scoped filtering instead of skipping the metadata rebuild entirely. When some source topics are missing partition metadata, we log that and continue rebuilding metadata for stores whose source topics are present. This avoids rebuilding StreamsMetadataState with incomplete metadata (the [KAFKA-9651](https://issues.apache.org/jira/browse/KAFKA-9651) failure mode) while still allowing unrelated stores to refresh their metadata.
   
   @lucasbru Can you have an another look after last commit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-3994916704

   > > Note: Although the producer side already has validated the partition size is > 0, the stream side (like [here](https://github.com/apache/kafka/blob/c77a96d13238c3127dc8cf016d437efb5e64bfa9/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.java#L480)) I cannot see all places have the partition size validation. Adding a validation in the partitionFor makes sense to me to avoid missing validation. When we have a fail use case reported, I think we should fix in the root to have re-fetch metadata mechanism or something.
   > 
   > @showuon Added validation in StreamsMetadataState.
   
   Is this really needed? Let's say, if you don't have the change in the commit: https://github.com/apache/kafka/pull/21609/commits/86511ce4ddff31128b884cc008ee0efc8e7157fa , the `shouldFailWhenSourceTopicHasNoPartitionsInMetadata` test can still pass because the `IllegalStateException` will be thrown in the `partitionForKey` method, right? I mean, if possible, we should fix from the root, instead of adding validation here and there, but still fail the application. WDYT?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-4025747878

   > > @nileshkumar3 But how does the retry work? Suppose my topic metadata is insufficient after a rebalance. What triggers a new rebalance?
   
   If we observe zero-partition metadata, we skip updating Streams metadata for now. A later broker metadata refresh will trigger a retry once metadata is complete. If refresh is delayed, metadata may remain stale temporarily, but that is safer than accepting an empty partition view and reintroducing the KAFKA-9651 failure mode.  Do you have  some suggestion to improve or better fix.  I can explore and do the suggested change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-4025811350

   @lucasbru This change is scoped to preventing StreamsMetadataState from being rebuilt using incomplete source-topic metadata, and to retrying once broker metadata is refreshed. If you think it’s useful, I can follow up with a KIP to formalize broader Streams behavior for incomplete metadata (retry policy, timeout semantics, and observability).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-4025493370

   @nileshkumar3 But how does the retry work? Suppose my topic metadata is insufficient after a rebalance. What triggers a new rebalance?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-3995012467

   > > > Note: Although the producer side already has validated the partition size is > 0, the stream side (like [here](https://github.com/apache/kafka/blob/c77a96d13238c3127dc8cf016d437efb5e64bfa9/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.java#L480)) I cannot see all places have the partition size validation. Adding a validation in the partitionFor makes sense to me to avoid missing validation. When we have a fail use case reported, I think we should fix in the root to have re-fetch metadata mechanism or something.
   > > 
   > > 
   > > @showuon Added validation in StreamsMetadataState.
   > 
   > Is this really needed? Let's say, if you don't have the change in the commit: [86511ce](https://github.com/apache/kafka/commit/86511ce4ddff31128b884cc008ee0efc8e7157fa) , the `shouldFailWhenSourceTopicHasNoPartitionsInMetadata` test can still pass because the `IllegalStateException` will be thrown in the `partitionForKey` method, right? I mean, if possible, we should fix from the root, instead of adding validation here and there, but still fail the application. WDYT?
   
   yes what you think make sense. we should add validation at the root. before streamsMetadataState.onChange in StreamThread and StreamsPartitionAssginor.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-4016888834

   @showuon @lucasbru Can you please review
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru commented on code in PR #21609:
URL: https://github.com/apache/kafka/pull/21609#discussion_r2905510090


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java:
##########
@@ -1548,7 +1548,15 @@ public void onAssignment(final Assignment assignment, final ConsumerGroupMetadat
             partitionsByHost.keySet()
         );
 
-        streamsMetadataState.onChange(partitionsByHost, standbyPartitionsByHost, topicToPartitionInfo);
+        final Set<String> missingSourceTopics =
+            StreamsMetadataState.missingSourceTopicsForMetadata(topicToPartitionInfo, taskManager.topologyMetadata());
+        if (missingSourceTopics.isEmpty()) {
+            streamsMetadataState.onChange(partitionsByHost, standbyPartitionsByHost, topicToPartitionInfo);
+        } else {
+            log.info("Skipping streams metadata update because partition metadata is missing for source topics {}. " +
+                    "Will retry after metadata is refreshed.", missingSourceTopics);
+            streamsMetadataState.onChange(Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap());

Review Comment:
   Will this mean that if one source topic is missing, the IQ metadata will become completely empty? Is this a regression?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:handling 0 partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-3994777248

   > @nileshkumar3 , thanks for the PR! Please help change the PR title to prefix with `MINOR:` or `KAFKA-xxxx`. You can check what others did: https://github.com/apache/kafka/pulls?page=2&q=is%3Apr+is%3Aopen
   > 
   > Also, please make the PR description format correct and clear. Thanks.
   @showuon done
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] handling 0 partitions [kafka]

Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-3981467904

   @nileshkumar3 , thanks for the PR! Please help change the PR title to prefix with `MINOR:` or `KAFKA-xxxx`. You can check what others did: https://github.com/apache/kafka/pulls?page=2&q=is%3Apr+is%3Aopen
   
   Also, please make the PR description format correct and clear. Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] handling 0 partitions [kafka]

Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-3981672417

   Note: Although the producer side already has validated the partition size is > 0, the stream side  (like [here](https://github.com/apache/kafka/blob/c77a96d13238c3127dc8cf016d437efb5e64bfa9/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.java#L480)) I cannot see all places have the partition size validation. Adding a validation in the partitionFor makes sense to me to avoid missing validation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-4024260125

   > Not sure I fully understand the change yet...
   
    Streams will no longer rebuild StreamsMetadataState from incomplete source-topic partition metadata. If metadata for a required source topic is missing, we skip the update and wait for the next metadata refresh, avoiding invalid partition calculations caused by partial metadata.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru commented on code in PR #21609:
URL: https://github.com/apache/kafka/pull/21609#discussion_r2905497935


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.java:
##########
@@ -319,6 +320,24 @@ synchronized void onChange(final Map<HostInfo, Set<TopicPartition>> activePartit
         rebuildMetadata(activePartitionHostMap, standbyPartitionHostMap);
     }
 
+    static Set<String> missingSourceTopicsForMetadata(final Map<TopicPartition, PartitionInfo> topicPartitionInfo,
+                                                      final TopologyMetadata topologyMetadata) {
+        final Set<String> topicsWithMetadata = topicPartitionInfo.keySet().stream()
+            .map(TopicPartition::topic)
+            .collect(Collectors.toSet());
+        final Set<String> globalStores = topologyMetadata.globalStateStores().keySet();
+        final Set<String> missingSourceTopics = new LinkedHashSet<>();
+
+        topologyMetadata.stateStoreNameToSourceTopics().forEach((storeName, sourceTopics) -> {

Review Comment:
   Why are we using state stores here. What if we have a topology without state stores?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-9651: Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-5099998006

   This PR is being marked as stale since it has not had any activity in 90 days. If you
   would like to keep this PR alive, please leave a comment asking for a review. If the PR has 
   merge conflicts, update it with the latest from the base branch.
   <p>
   If you are having difficulty finding a reviewer, please reach out on the 
   [mailing list](https://kafka.apache.org/contact).
   <p>
   If this PR is no longer valid or desired, please feel free to close it. If no activity
   occurs in the next 30 days, it will be automatically closed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on code in PR #21609:
URL: https://github.com/apache/kafka/pull/21609#discussion_r2905752308


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.java:
##########
@@ -319,6 +320,24 @@ synchronized void onChange(final Map<HostInfo, Set<TopicPartition>> activePartit
         rebuildMetadata(activePartitionHostMap, standbyPartitionHostMap);
     }
 
+    static Set<String> missingSourceTopicsForMetadata(final Map<TopicPartition, PartitionInfo> topicPartitionInfo,
+                                                      final TopologyMetadata topologyMetadata) {
+        final Set<String> topicsWithMetadata = topicPartitionInfo.keySet().stream()
+            .map(TopicPartition::topic)
+            .collect(Collectors.toSet());
+        final Set<String> globalStores = topologyMetadata.globalStateStores().keySet();
+        final Set<String> missingSourceTopics = new LinkedHashSet<>();
+
+        topologyMetadata.stateStoreNameToSourceTopics().forEach((storeName, sourceTopics) -> {

Review Comment:
   For a topology without state stores, this map is empty, so the loop becomes a no-op rather than failing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] kAFKA-9651:Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on code in PR #21609:
URL: https://github.com/apache/kafka/pull/21609#discussion_r2905791173


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java:
##########
@@ -1548,7 +1548,15 @@ public void onAssignment(final Assignment assignment, final ConsumerGroupMetadat
             partitionsByHost.keySet()
         );
 
-        streamsMetadataState.onChange(partitionsByHost, standbyPartitionsByHost, topicToPartitionInfo);
+        final Set<String> missingSourceTopics =
+            StreamsMetadataState.missingSourceTopicsForMetadata(topicToPartitionInfo, taskManager.topologyMetadata());
+        if (missingSourceTopics.isEmpty()) {
+            streamsMetadataState.onChange(partitionsByHost, standbyPartitionsByHost, topicToPartitionInfo);
+        } else {
+            log.info("Skipping streams metadata update because partition metadata is missing for source topics {}. " +
+                    "Will retry after metadata is refreshed.", missingSourceTopics);
+            streamsMetadataState.onChange(Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap());

Review Comment:
   Good catch — yes, this would clear IQ metadata entirely for that cycle, so it can be a regression. We should preserve the previous streamsMetadataState and truly skip the update until metadata is complete.i will do the changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] handling 0 partitions [kafka]

Posted by "nileshkumar3 (via GitHub)" <gi...@apache.org>.
nileshkumar3 commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-3981044025

   @tombentley Can you review this


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-9651: Handle edge case when partition metadata contains zero partitions [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21609:
URL: https://github.com/apache/kafka/pull/21609#issuecomment-5739066800

   This PR has been closed since it has not had any activity in 120 days. If you feel like this
   was a mistake, or you would like to continue working on it, please feel free to re-open the 
   PR and ask for a review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org