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


##########
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:
   The recent code changes are now correctly reflected in this pull request. 
You can now see the updates in both CommitLogReader.java and 
CommitLogReaderTest.java. Kindly review the latest commits and let me know if 
any further changes or improvements are needed.
   
   Thanks
   



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