mitalawachat commented on code in PR #14104: URL: https://github.com/apache/kafka/pull/14104#discussion_r1275885135
########## 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: > an info log prior to checking indexes would be helpful to understand where the code exited when one of the sanity check fails `sanityCheck()` throws an exception which contains `file.getAbsolutePath`, and exception should be caught and logged by caller. -- 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