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

Jiangjie Qin commented on KAFKA-3203:
-------------------------------------

[~granthenke] The reason we don't use UnknownMagicByteException is probably 
because previously magic byte is always 0 so we don't even check it in the 
code. However, after KIP-31/KIP-32 and idempotent producer in the future, I 
think we will check magic byte. So I would prefer keeping it there. There are 
two possibilities magic byte can go wrong: 1) unknown 2) invalid because of 
something like broker setting, format mismatch, etc. Should we change the 
exception to be InvalidMagicByteException?

I don't have a strong opinion on error code mapping. But according to the 
current description, corrupted message specifically means CRC does not match. 
Personally I would prefer having separate error code for magic byte error and 
codec error. It seems clearer to client developers and users.

> Add UnknownCodecException and UnknownMagicByteException to error mapping
> ------------------------------------------------------------------------
>
>                 Key: KAFKA-3203
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3203
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, core
>    Affects Versions: 0.9.0.0
>            Reporter: Jiangjie Qin
>            Assignee: Grant Henke
>             Fix For: 0.10.0.0, 0.9.1.0
>
>
> Currently most of the exceptions to user have an error code. While 
> UnknownCodecException and UnknownMagicByteException can also be thrown to 
> client, broker does not have error mapping for them, so clients will only 
> receive UnknownServerException, which is vague.
> We should create those two exceptions in client package and add them to error 
> mapping.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to