ibessonov commented on code in PR #4437:
URL: https://github.com/apache/ignite-3/pull/4437#discussion_r1773254929


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java:
##########
@@ -1511,25 +1526,28 @@ public boolean tryToRemovePage(FullPageId fullPageId, 
long absPtr) throws Ignite
 
             if (isDirty(absPtr)) {
                 CheckpointPages checkpointPages = this.checkpointPages;
-                // Can evict a dirty page only if should be written by a 
checkpoint.
-                // These pages does not have tmp buffer.
-                if (checkpointPages != null && 
checkpointPages.allowToSave(fullPageId)) {
-                    WriteDirtyPage writeDirtyPage = 
delayedPageReplacementTracker.delayedPageWrite();
-
-                    writeDirtyPage.write(PersistentPageMemory.this, 
fullPageId, wrapPointer(absPtr + PAGE_OVERHEAD, pageSize()));
-
-                    setDirty(fullPageId, absPtr, false, true);
+                // Can replace a dirty page only if should be written by a 
checkpoint.
+                // Safe to invoke because we keep segment write lock and the 
checkpoint writer must remove pages on the segment read lock.
+                if (checkpointPages != null && 
checkpointPages.allowToReplace(pageId) && checkpointPages.remove(pageId)) {

Review Comment:
   > Maybe when we detect the need to replace a page, we should release the 
segment locks, wait for the page sorting to complete, and only then take the 
lock again and try to replace the page.
   
   Maybe, that's one option. But that's for the future, I agree with you



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