netudima commented on code in PR #4207:
URL: https://github.com/apache/cassandra/pull/4207#discussion_r2162553117


##########
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:
   I'm sorry, I did not get: continue statement is a kind of goto to the next 
iteration of the for loop ("for (File file : filteredLogs)" in our case) and we 
have "continue" here as a last statement of the loop code, so in any case we go 
to the next iteration of the loop after it, it does not matter if we have 
"continue" or not. Am I missing something?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to