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

shizhenzhen commented on KAFKA-14329:
-------------------------------------

对于这里的异常 ,我觉得没有必只要有分区异常就抛出来,而是应该判断查询的分区有异常的话就抛出来。

 

看这里的代码(当然我并不是说要在这里修改)

 

!image-2022-10-24-16-47-03-180.png!

 

 

另一个相关的异常:https://issues.apache.org/jira/browse/KAFKA-14328

 

 

[~showuon] [~dengziming]   [~guozhang] 

 

 

 

> KafkaAdminClient#listOffsets should query by partition dimension
> ----------------------------------------------------------------
>
>                 Key: KAFKA-14329
>                 URL: https://issues.apache.org/jira/browse/KAFKA-14329
>             Project: Kafka
>          Issue Type: Improvement
>          Components: admin
>    Affects Versions: 2.7.2
>            Reporter: shizhenzhen
>            Priority: Major
>              Labels: bug
>         Attachments: image-2022-10-24-16-18-01-418.png, 
> image-2022-10-24-16-20-31-778.png, image-2022-10-24-16-47-03-180.png
>
>
>  
> listOffsets接口查询 TopicPartition分区Offset的时候,  正常来说应该是按照分区维度来查询的
>  
> 比如 我查询了 Topic1-0  、Topic1-1 ; 返回对应的数据。
>  
> 正常情况下是这样没错,但是在调用这个接口之前 先调用了 Metadata接口。
>  
> 并且在处理Metadata返回数据的时候,判断了如果对应的Topic有一个Topic分区leader不存在。都会抛出异常。如下:
>  
> !image-2022-10-24-16-20-31-778.png!
>  
>  
> !image-2022-10-24-16-18-01-418.png!
>  
>  
> 假设这种情况:
>  
> Topic1 有3个分区; Topic1-0;Topic1-1; Topic1-2 ;
>  
> 但是刚好 Topic1-2 这个分区由于某些原因导致分区Leader = -1
>  
> 这个时候我想去查询  Topic1-0;Topic1-1; 这两个分区的Offset的时候,它直接给我抛出来异常了
>  
> 正常逻辑,我这里没有涉及到有问题的Topic1-2;  我应该是能够查询出来数据的。
>  
> 但是却给我异常了,这非常的不友好。
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to