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

Uladzislau Blok edited comment on KAFKA-19613 at 8/26/25 2:14 PM:
------------------------------------------------------------------

[~lianetm] 
Hello 
Just today I've got an access to Kafka Confluence. I'll start working on KIP 
ASAP
Re-think my idea and what I see:
What client (FetchCollector#handleInitializeErrors) gives us is not an offset 
of corrupted message, but message we were trying to fetch. See an example:
!corrupted_records.excalidraw.png!

 

If consumer is trying to read 512 bytes it will fail, as a response will 
contain 2 messages and corrupted part. Correct me, if I'm wrong here

My proposal was to skip (seek last read offset +1) until we'll read 
successfully, but this way we can lose the messages. 
We can also do something else... return the messages before corruption... and 
return the corrupted offset from the broker, here I don't know how many afford 
it will take. I need to analyze it. What do you think?


was (Author: JIRAUSER309258):
[~lianetm] 
Hello 
Just today I've got an access to Kafka Confluence. I'll start working on KIP 
ASAP
Re-think my idea and what I see:
Clients (FetchCollector#handleInitializeErrors) gives us is not an offset of 
corrupted message, but message we were trying to fetch. See an example:
!corrupted_records.excalidraw.png!

 

If consumer is trying to read 512 bytes it will fail, as a response will 
contain 2 messages and corrupted part. Correct me, if I'm wrong 

My proposal was to skip (seek last read offset +1) until we'll read 
successfully, but this way we can lose the messages. 
We can also do something else... return the messages before corruption... and 
return the corrupted offset from the broker, here I don't know how many afford 
it will take. I need to analyze it. What do you think?

> Expose consumer CorruptRecordException as case of KafkaException
> ----------------------------------------------------------------
>
>                 Key: KAFKA-19613
>                 URL: https://issues.apache.org/jira/browse/KAFKA-19613
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>            Reporter: Uladzislau Blok
>            Assignee: Uladzislau Blok
>            Priority: Minor
>              Labels: need-kip
>         Attachments: corrupted_records.excalidraw.png
>
>
> As part of analysis of KAFKA-19430 , we decided it would be useful to expose 
> root case of consumer request failure (e.g. currently we see just 
> KafkaException instead of CorruptRecordException)
> The idea is to not change public API, but expose root case as a filed of 
> KafkaException



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

Reply via email to