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


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java:
##########
@@ -1115,25 +1115,64 @@ private long writeLockPage(long absPtr, FullPageId 
fullId, boolean checkTag) {
     private long postWriteLockPage(long absPtr, FullPageId fullId) {
         writeTimestamp(absPtr, coarseCurrentTimeMillis());
 
+        copyPageIfInCheckpoint(absPtr, fullId);
+
+        assert getCrc(absPtr + PAGE_OVERHEAD) == 0; // TODO IGNITE-16612
+
+        return absPtr + PAGE_OVERHEAD;
+    }
+
+    private void copyPageIfInCheckpoint(long absPtr, FullPageId fullId) {
+        Segment seg = segment(fullId);
+
+        if (!seg.isInCheckpoint(fullId) || tempBufferPointer(absPtr) != 
INVALID_REL_PTR) {
+            return;
+        }
+
         // Create a buffer copy if the page is scheduled for a checkpoint.
-        if (isInCheckpoint(fullId) && tempBufferPointer(absPtr) == 
INVALID_REL_PTR) {
-            long tmpRelPtr;
+        long tmpRelPtr;
 
-            PagePool checkpointPool = this.checkpointPool;
+        PagePool checkpointPool = this.checkpointPool;
 
-            while (true) {
-                tmpRelPtr = 
checkpointPool.borrowOrAllocateFreePage(tag(fullId.pageId()));
+        while (true) {
+            int tag = tag(fullId.pageId());

Review Comment:
   Get rid of it.



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java:
##########
@@ -1115,25 +1115,64 @@ private long writeLockPage(long absPtr, FullPageId 
fullId, boolean checkTag) {
     private long postWriteLockPage(long absPtr, FullPageId fullId) {
         writeTimestamp(absPtr, coarseCurrentTimeMillis());
 
+        copyPageIfInCheckpoint(absPtr, fullId);
+
+        assert getCrc(absPtr + PAGE_OVERHEAD) == 0; // TODO IGNITE-16612
+
+        return absPtr + PAGE_OVERHEAD;
+    }
+
+    private void copyPageIfInCheckpoint(long absPtr, FullPageId fullId) {

Review Comment:
   Get rid of it.



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