chia7712 commented on code in PR #16558:
URL: https://github.com/apache/kafka/pull/16558#discussion_r1685704339


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogValidator.java:
##########
@@ -574,7 +574,7 @@ private static Optional<ApiRecordError> 
validateRecord(RecordBatch batch,
         if (batch.magic() <= RecordBatch.MAGIC_VALUE_V1 && 
batch.isCompressed()) {
             try {
                 record.ensureValid();
-            } catch (InvalidRecordException e) {

Review Comment:
   In order to keep consistency, we should rethrow  `CorruptRecordException` 
here. for example:
   ```java
               } catch (CorruptRecordException e) {
                   metricsRecorder.recordInvalidChecksums();
                   throw e;
               } catch (InvalidRecordException e) {
                   metricsRecorder.recordInvalidChecksums();
                   throw new CorruptRecordException(e.getMessage() + " in topic 
partition " + topicPartition);
               }
   ```



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