Hmm.. We typically recompress if the producer uses a compression type which 
doesn't match the topic configuration. In retrospect, this was probably not a 
great decision, but I think it is better to be consistent here. For example, we 
would still recompress as zstd if the user sends a gzip-encoded message format 
with produce version 7. I'd expect the behavior to be consistent for 
gzip-encoded data in a v6 produce request. So maybe we can just remove this 
check?

A separate question is whether we should be strict about the use of zstd in 
older produce request versions. Like if a buggy client sent a v6 produce 
request which used zstd. Should we reject it? I'm not sure if there's a big 
advantage to doing so, so I think we can probably keep the validation loose.

However, I do think there is value in enforcing our expectation that zstd can 
only be used with message format v2. Perhaps we can add a check to 
`LogValidator.validateMessagesAndAssignOffsetsCompressed` for this? We can 
raise `InvalidRecordException` if zstd is used with v0 or v1 of the message 
format.

[ Full content available at: https://github.com/apache/kafka/pull/2267 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org

Reply via email to