Nickstery commented on code in PR #14104:
URL: https://github.com/apache/kafka/pull/14104#discussion_r1276035377


##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -599,6 +602,13 @@ private void copyLogSegment(UnifiedLog log, LogSegment 
segment, long nextSegment
             File logFile = segment.log().file();
             String logFileName = logFile.getName();
 
+            // Corrupted indexes should not be uploaded to remote storage
+            // Example case: Local storage was filled, what caused index 
corruption
+            // We should avoid uploading such segments
+            segment.timeIndex().sanityCheck();
+            segment.offsetIndex().sanityCheck();
+            segment.txnIndex().sanityCheck();
+
             logger.info("Copying {} to remote storage.", logFileName);

Review Comment:
   Yes, `sanityCheck` throws an Exception `CorruptIndexException`, which I 
catch and add additional log line: `Error occurred while copying log segments. 
Index appeared to be corrupted for partition: {}`



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to