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

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

dongjinleekr commented on pull request #6256: KAFKA-7920: Do not permit zstd 
use until inter.broker.protocol.version is updated to 2.1
URL: https://github.com/apache/kafka/pull/6256
 
 
   Here is the fix. Since `inter.broker.protocol.version` is defined in 
`KafkaConfig` (not `LogConfig`), I concluded that `ProduceRequest` validation 
routine is the best place for check. (I first thought that `LogValidator` would 
be the right place, but it required too many parameter passing. So I rejected 
that approach.)
   
   Here are the details:
   
   1. Add `Optional<Integer> interBrokerProtocolVersion` to 
`ProduceRequest#validateRecords.`
   2. Disallow zstd compressed `MemoryRecords` if 
`inter.broker.protocol.version` < 2.1 (i.e., `ApiVersion.id` = 17).
   3. Add `ProduceRequest#validateRecords(short, MemoryRecords)` for backward 
compatibility.
   4. Fix a typo: "note allowed to" → "not allowed to"
   
   ### 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 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


> Do not permit zstd use until inter.broker.protocol.version is updated to 2.1
> ----------------------------------------------------------------------------
>
>                 Key: KAFKA-7920
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7920
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 2.1.0
>            Reporter: Jason Gustafson
>            Priority: Major
>
> After brokers have been upgraded to 2.1, users can begin using zstd 
> compression. Regardless of the inter.broker.protocol.version, the broker will 
> happily accept zstd-compressed data as long as the right produce request 
> version is used. However, if the inter.broker.protocol.version is set to 2.0 
> or below, then followers will not be able to use the minimum required fetch 
> version, which will result in the following error:
> {code}
> [2019-02-11 17:42:47,116] ERROR [ReplicaFetcher replicaId=2, leaderId=1, 
> fetcherId=0] Error for partition foo-0 at offset 0 
> (kafka.server.ReplicaFetcherThread)                                           
>                                                                               
>  
> org.apache.kafka.common.errors.UnsupportedCompressionTypeException: The 
> requesting client does not support the compression type of given partition.
> {code}
> We should make produce request validation consistent. Until the 
> inter.broker.protocol.version is at 2.1 or later, we should reject produce 
> requests with UNSUPPORTED_COMPRESSION_TYPE.



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

Reply via email to