dhruvilshah3 commented on a change in pull request #10388:
URL: https://github.com/apache/kafka/pull/10388#discussion_r601867771



##########
File path: core/src/main/scala/kafka/log/Log.scala
##########
@@ -700,11 +700,13 @@ class Log(@volatile private var _dir: File,
           case _: NoSuchFileException =>
             error(s"Could not find offset index file corresponding to log file 
${segment.log.file.getAbsolutePath}, " +
               "recovering segment and rebuilding index files...")
-            recoverSegment(segment)
+            if (segment.validateSegmentAndRebuildIndices() > 0)
+              throw new KafkaStorageException("Found invalid or corrupted 
messages in segment " + segment.log.file);

Review comment:
       Done.




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


Reply via email to