tkalkirill commented on code in PR #2594:
URL: https://github.com/apache/ignite-3/pull/2594#discussion_r1328323527


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointWorkflow.java:
##########
@@ -343,14 +365,35 @@ private DataRegionsDirtyPages beginCheckpoint(
             Collection<? extends DataRegion<PersistentPageMemory>> dataRegions,
             CompletableFuture<?> allowToReplace
     ) {
+        Map<DataRegion<?>, Set<FullPageId>> dirtyPartitionsMap = 
this.dirtyPartitionsMap;
+
+        this.dirtyPartitionsMap = new ConcurrentHashMap<>();
+
         Collection<DataRegionDirtyPages<Collection<FullPageId>>> 
dataRegionsDirtyPages = new ArrayList<>(dataRegions.size());
 
+        // First, we iterate all regions that have dirty pages.
         for (DataRegion<PersistentPageMemory> dataRegion : dataRegions) {
             Collection<FullPageId> dirtyPages = 
dataRegion.pageMemory().beginCheckpoint(allowToReplace);
 
+            Set<FullPageId> dirtyMetaPageIds = 
dirtyPartitionsMap.remove(dataRegion);
+
+            if (dirtyMetaPageIds != null) {
+                // Merge these two collections. There should be no 
intersections.
+                dirtyPages = CollectionUtils.concat(dirtyMetaPageIds, 
dirtyPages);

Review Comment:
   Just a funny observation)



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