hsahu-ksolves123 commented on code in PR #4207:
URL: https://github.com/apache/cassandra/pull/4207#discussion_r2167320553


##########
src/java/org/apache/cassandra/db/commitlog/CommitLogReader.java:
##########
@@ -120,14 +120,25 @@ static List<File> filterCommitLogFiles(File[] toFilter)
     /**
      * Reads all passed in files with minPosition, no start, and no mutation 
limit.
      */
-    public void readAllFiles(CommitLogReadHandler handler, File[] files, 
CommitLogPosition minPosition) throws IOException
-    {
+    public void readAllFiles(CommitLogReadHandler handler, File[] files, 
CommitLogPosition minPosition) throws IOException {
         List<File> filteredLogs = filterCommitLogFiles(files);
         int i = 0;
-        for (File file: filteredLogs)
-        {
+        for (File file : filteredLogs) {
             i++;
-            readCommitLogSegment(handler, file, minPosition, ALL_MUTATIONS, i 
== filteredLogs.size());
+            boolean success = false;
+            try {
+                readCommitLogSegment(handler, file, minPosition, 
ALL_MUTATIONS, i == filteredLogs.size());
+                success = true;
+            } catch (Throwable t) {
+                handler.handleError(file, 
CommitLogReadErrorReason.UNRECOVERABLE_UNKNOWN_ERROR, t);
+                logger.warn("Skipping commit log file {} due to error: {}", 
file.name(), t.getMessage(), t);
+            }
+
+            // 🔴 Fix: If unsuccessful, skip to next without retrying
+            if (!success) {
+                logger.info("File {} was not processed successfully. Skipping 
to next.", file.name());
+                continue;

Review Comment:
   Hi @netudima,
   I've pushed the latest changes:
   1.Removed the redundant continue as discussed
   2.Added a unit test to reproduce and validate the fix
   3.Verified build and test locally
   
   Please review and let me know if any further updates are needed. Thank you!



-- 
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: pr-unsubscr...@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to