Phillippko commented on code in PR #7067:
URL: https://github.com/apache/ignite-3/pull/7067#discussion_r2567334646


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/compaction/Compactor.java:
##########
@@ -388,13 +389,37 @@ void mergeDeltaFileToMainFile(
         // Copy pages deltaFilePageStore -> filePageStore.
         ByteBuffer buffer = getThreadLocalBuffer(pageSize);
 
+        DeltaFilePageStoreIo[] newerDeltaFiles = 
filePageStore.getCompletedDeltaFiles()
+                .stream()
+                .filter(file -> file.fileIndex() > 
deltaFilePageStore.fileIndex())
+                .toArray(DeltaFilePageStoreIo[]::new);
+
+        int[] pointers = new int[newerDeltaFiles.length];
+
+        boolean shouldFsync = false;
         for (long pageIndex : deltaFilePageStore.pageIndexes()) {
             updateHeartbeat();
 
             if (shouldStopCompaction(filePageStore)) {
                 return;
             }
 
+            boolean shouldSkip = false;
+            for (int i = 0; i < pointers.length && !shouldSkip; i++) {
+                int[] newerPageIndexes = newerDeltaFiles[i].pageIndexes();
+
+                while (pointers[i] < newerPageIndexes.length - 1 && 
newerPageIndexes[pointers[i]] < pageIndex) {
+                    pointers[i]++;
+                }
+
+                shouldSkip = pointers[i] < newerPageIndexes.length && 
newerPageIndexes[pointers[i]] == pageIndex;

Review Comment:
   Yeah,  but this is expected. Next page processing will start from this 
pointer position, and if page should be skipped, it will be skipped. We 
couldn't miss this page in other delta files because all delta files are sorted 
in increasing order



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

Reply via email to