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

ASF GitHub Bot commented on KAFKA-8428:
---------------------------------------

guozhangwang commented on pull request #6816: KAFKA-8428: Always require a 
single batch with compressed messages
URL: https://github.com/apache/kafka/pull/6816
 
 
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Cleanup LogValidator#validateMessagesAndAssignOffsetsCompressed to assume 
> single record batch only
> --------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-8428
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8428
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Guozhang Wang
>            Assignee: Guozhang Wang
>            Priority: Major
>
> Today, the client -> server record batching protocol works like this:
> 1. With magic v2, we always require a single batch within compressed set. And 
> inside the LogValidator#validateMessagesAndAssignOffsetsCompressed we assume 
> so already.
> 2. With magic v1, our code actually also assumes one record batch, since 
> whenever inPlaceAssignment is true we assume one batch only; however with 
> magic v1 it is still possible that inPlaceAssignment == true.
> 3. With magic v0, our code does handle the case with multiple record batch, 
> since with v0 inPlaceAssignment is always false.
> This makes the logic of 
> LogValidator#validateMessagesAndAssignOffsetsCompressed quite twisted and 
> complicated.
> Since all standard clients implementation we've known so far actually all 
> wrap a single batch with compressed (of course, we cannot guarantee this is 
> the case for all clients in the wild, but I think the chance of multiple 
> batches with compressed records should really be rare), I think it's better 
> just to make it as a universal requirement for all versions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to