[ 
https://issues.apache.org/jira/browse/KAFKA-21188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18141263#comment-18141263
 ] 

sanghyeok An edited comment on KAFKA-21188 at 11/9/26, 1:54 PM:
----------------------------------------------------------------

[~lucasbru] 

Thank you for your detailed comments! 
I'd be more than happy to take on both the client-side fix and the KIP!

That said, I haven't fully understood all the points you've raised yet, so I'd 
like to take some more time to carefully go through your comments. 
I'll follow up with my thoughts once I've had a chance to review them more 
thoroughly.

In the meantime, there are two points I'd like to discuss first:
 # *What do you think the client should report in its Heartbeat when it cannot 
yet resolve the metadata for an assigned task?* For example, suppose the client 
is assigned tasks {{[0_0]}} and {{{}[1_0]{}}}, but it does not yet have 
metadata for one of the topics associated with {{{}[0_0]{}}}. Should the client 
report both {{[0_0]}} and {{{}[1_0]{}}}, or only {{{}[1_0]{}}}?
 # *If the client should report only* {{{}*[1_0]*{}}}{*}, wouldn't that 
potentially conflict with KIP-1071?{*}

In my current implementation, I've assumed that the client should report both 
{{[0_0]}} and {{{}[1_0]{}}}.

My reasoning is that the unit of assignment differs between KIP-848 and 
KIP-1071: KIP-848 assigns topic partitions, whereas KIP-1071 assigns tasks.

Based on this distinction, I thought that even if a Streams client temporarily 
lacks the metadata needed to fully resolve a task's input partitions, it could 
still consider that task to be owned, since the task has already been assigned 
to it by the Group Coordinator.

I'd be interested to hear your thoughts on this. 
Am I overlooking anything in this interpretation?


was (Author: JIRAUSER303328):
[~lucasbru] 

Thank you for your detailed comments! 
I'd be more than happy to take on both the client-side fix and the KIP!

That said, I haven't fully understood all the points you've raised yet, so I'd 
like to take some more time to carefully go through your comments. 
I'll follow up with my thoughts once I've had a chance to review them more 
thoroughly.


In the meantime, there are two points I'd like to discuss first:
 # *What do you think the client should report in its Heartbeat when it cannot 
yet resolve the metadata for an assigned task?* For example, suppose the client 
is assigned tasks {{[0_0]}} and {{{}[1_0]{}}}, but it does not yet have 
metadata for one of the topics associated with {{{}[0_0]{}}}. Should the client 
report both {{[0_0]}} and {{{}[1_0]{}}}, or only {{{}[1_0]{}}}?

 # *If the client should report only* {{{}*[1_0]*{}}}{*}, wouldn't that 
potentially conflict with KIP-1071?{*}


In my current implementation, I've assumed that the client should report both 
{{[0_0]}} and {{{}[1_0]{}}}.

My reasoning is that the unit of assignment differs between KIP-848 and 
KIP-1071: KIP-848 assigns topic partitions, whereas KIP-1071 assigns tasks.

Based on this distinction, I thought that even if a Streams client temporarily 
lacks the metadata needed to fully resolve a task's input partitions, it could 
still consider that task to be owned, since the task has already been assigned 
to it by the Group Coordinator.

I'd be interested to hear your thoughts on this. 
Am I overlooking anything in this interpretation?

> Merging topics with different partition counts leaves some records 
> unprocessed under the Streams Rebalance Protocol
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-21188
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21188
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, streams
>            Reporter: sanghyeok An
>            Assignee: sanghyeok An
>            Priority: Major
>
> With {*}group.protocol=streams{*}, merging two topics with different 
> partition counts includes nonexistent partitions in the tasks’ inputs, 
> leaving some records unprocessed.
> *Steps to Reproduce*
> 1. Create topic A with 1 partition({*}0{*}) and topic B with 3 
> partitions({*}0, 1, 2{*}).
> 2. Run the following topology with {*}group.protocol=streams{*}:
> {code:java}
> KStream<String, String> streamA = builder.stream("A");
> KStream<String, String> streamB = builder.stream("B");
> streamA.merge(streamB).to("output");
> {code}
> 3. Produce records to {*}A-0{*}, {*}B-0{*}, {*}B-1{*}, and {*}B-2{*}.
>  * *Expected:* All input records appear in `output`.
>  * *Actual:* Records from `B-1` and `B-2` do not appear in `output`, and the 
> following messages repeatedly reference nonexistent partitions:
> {code:java}
> Requesting the log end offset for A-1 in order to compute lag
> Requesting the log end offset for A-2 in order to compute lag
> {code}
>  
> *Cause*
> StreamsMembershipManager#topicPartitionsForActiveTasks and 
> DefaultStreamsRebalanceListener#toTopicPartitions apply the task’s partition 
> ID to every input topic without checking each topic’s partition count.
> As a result, a task that should include only *B-1* also includes {*}A-1{*}. 
> The same issue occurs for partition ID 2.
> The classic protocol’s PartitionGrouper checks each topic’s partition count 
> and includes only existing partitions. The new protocol’s conversion paths 
> need equivalent handling.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to