gaurav-narula commented on code in PR #24172:
URL: https://github.com/apache/kafka/pull/24172#discussion_r4585357944


##########
clients/src/main/java/org/apache/kafka/common/record/LazyDownConversionRecordsSend.java:
##########
@@ -90,6 +90,13 @@ public int writeTo(TransferableChannel channel, int 
previouslyWritten, int remai
                 // offset of the batch which has the unsupported compression 
type. At that time, we will
                 // send back the UNSUPPORTED_COMPRESSION_TYPE error which will 
allow the consumer to fail gracefully.
                 convertedRecords = buildOverflowBatch(remaining);
+            } catch (RecordSizeLimitExceededException e) {
+                // We have encountered a record whose decompressed body 
exceeds the topic's
+                // max.decompressed.message.bytes. As above, we have already 
committed to the fetch size, so we send
+                // an overflow batch. The consumer will then fetch from the 
offset of the offending batch, at which
+                // point the eager conversion of the first batch fails and the 
INVALID_RECORD error is returned.
+                log.warn("Failed to down-convert records for partition {}, 
sending an overflow batch instead", topicPartition(), e);
+                convertedRecords = buildOverflowBatch(remaining);

Review Comment:
   Thanks! Addressed and added a test as well



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to