nizhikov commented on code in PR #10766:
URL: https://github.com/apache/ignite/pull/10766#discussion_r1255964521


##########
modules/core/src/main/java/org/apache/ignite/internal/management/cdc/CdcDeleteLostSegmentsTask.java:
##########
@@ -102,69 +115,138 @@ protected 
CdcDeleteLostSegmentsJob(CdcDeleteLostSegmentLinksCommandArg arg, bool
             try {
                 lock.tryLock(1);
 
-                try (Stream<Path> cdcFiles = Files.list(walCdcDir.toPath())) {
-                    Set<File> delete = new HashSet<>();
+                Long lostSgmnt = findLastLostSegement();
 
-                    AtomicLong lastSgmnt = new AtomicLong(-1);
+                if (lostSgmnt != null)
+                    deleteAll(lostSgmnt);
 
-                    cdcFiles
-                        .filter(p -> 
WAL_SEGMENT_FILE_FILTER.accept(p.toFile()))
-                        
.sorted(Comparator.comparingLong(FileWriteAheadLogManager::segmentIndex)
-                            .reversed()) // Sort by segment index.
-                        .forEach(path -> {
-                            long idx = 
FileWriteAheadLogManager.segmentIndex(path);
+                Long cdcDisableSgmnt = findLastCdcDisableSegment();

Review Comment:
   findLastCdcDisableSegment -> findLastSegmentWithCdcDisabledRecord.
   
   cdcDisableSgmnt -> lastSegWithDisabledRec



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to