tkalkirill commented on code in PR #6354:
URL: https://github.com/apache/ignite-3/pull/6354#discussion_r2247663972
##########
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:
No, it’s not necessary, I returned it as it was, I did it by accident.
--
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]