ibessonov commented on code in PR #7023:
URL: https://github.com/apache/ignite-3/pull/7023#discussion_r2545430983
##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java:
##########
@@ -811,13 +801,34 @@ grpId, hexLong(pageId)
actualPageId = getPageId(buf);
metrics.incrementReadFromDiskMetric();
+
+ // At this point we guarantee that after write lock is
released, page will have a valid header that's consistent with
+ // page content.
+ headerIsValid(lockedPageAbsPtr, true);
} finally {
rwLock.writeUnlock(lockedPageAbsPtr + PAGE_LOCK_OFFSET,
actualPageId == 0 ? TAG_LOCK_ALWAYS : tag(actualPageId));
}
}
}
}
+ /**
+ * This method is called when the thread finishes acquiring the page, but
this thread is not the one that reads page data from the
+ * storage. Such a waiting is required to receive a valid state of page
header, in particular we need a valid state of {@link #rwLock}
+ * for a given page.
+ */
+ private void waitUntilPageIsFullyInitialized(long absPtr) {
+ // We're fine with non-volatile reads and potential false-negative
result, because the following operation is idempotent.
Review Comment:
I'm not sure actually, let's discuss 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]