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


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/compaction/Compactor.java:
##########
@@ -388,13 +389,38 @@ 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];
+
         for (long pageIndex : deltaFilePageStore.pageIndexes()) {
             updateHeartbeat();
 
             if (shouldStopCompaction(filePageStore)) {
                 return;
             }
 
+            boolean shouldSkip = false;
+            for (int i = 0; i < pointers.length; i++) {
+                int[] newerPageIndexes = newerDeltaFiles[i].pageIndexes();
+
+                while (pointers[i] < newerPageIndexes.length - 1 && 
newerPageIndexes[pointers[i]] < pageIndex) {

Review Comment:
   As we continue using pointers array, it looks kinda shitty



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