You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Vladsz83 (via GitHub)" <gi...@apache.org> on 2026/03/12 13:27:48 UTC
[PR] IGNITE-28133 : Failure on cache.get() at the eviction v3 - CAS [ignite]
Vladsz83 opened a new pull request, #12884:
URL: https://github.com/apache/ignite/pull/12884
(no comment)
--
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-28133 : Failure on cache.get() at the eviction v3 - CAS [ignite]
Posted by "alex-plekhanov (via GitHub)" <gi...@apache.org>.
alex-plekhanov commented on code in PR #12884:
URL: https://github.com/apache/ignite/pull/12884#discussion_r2925269032
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/evict/Random2LruPageEvictionTracker.java:
##########
@@ -80,35 +80,49 @@ public Random2LruPageEvictionTracker(
}
/** {@inheritDoc} */
- @Override public void touchPage(long pageId) throws IgniteCheckedException {
+ @Override public void touchPage(long pageId) {
int pageIdx = PageIdUtils.pageIndex(pageId);
-
- long latestTs = compactTimestamp(U.currentTimeMillis());
-
- assert latestTs >= 0 && latestTs < Integer.MAX_VALUE;
+ int trackingIdx = trackingIdx(pageIdx);
+ long trackingPtr = trackingArrPtr + trackingIdx * 8L;
boolean success;
+ long trackingData;
+ long newTrackingData;
+ long ts;
+ int firstTs;
+ int secondTs;
Review Comment:
It looks like there is no reason to extract these declaration outside the loop
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/evict/Random2LruPageEvictionTracker.java:
##########
@@ -80,35 +80,49 @@ public Random2LruPageEvictionTracker(
}
/** {@inheritDoc} */
- @Override public void touchPage(long pageId) throws IgniteCheckedException {
+ @Override public void touchPage(long pageId) {
int pageIdx = PageIdUtils.pageIndex(pageId);
-
- long latestTs = compactTimestamp(U.currentTimeMillis());
-
- assert latestTs >= 0 && latestTs < Integer.MAX_VALUE;
+ int trackingIdx = trackingIdx(pageIdx);
+ long trackingPtr = trackingArrPtr + trackingIdx * 8L;
boolean success;
+ long trackingData;
+ long newTrackingData;
+ long ts;
+ int firstTs;
+ int secondTs;
do {
- int trackingIdx = trackingIdx(pageIdx);
+ trackingData = GridUnsafe.getLongVolatile(null, trackingPtr);
- long trackingData = GridUnsafe.getLongVolatile(null, trackingArrPtr + trackingIdx * 8L);
+ firstTs = first(trackingData);
- int firstTs = first(trackingData);
+ if (firstTs <= 0) // Concurrently evicted.
+ return;
- assert firstTs >= 0 : "[firstTs=" + firstTs + ", trackingData=" + trackingData + "]";
+ ts = compactTimestamp(U.currentTimeMillis());
- int secondTs = second(trackingData);
+ assert ts >= 0 && ts < Integer.MAX_VALUE;
- long newTrackingData;
+ secondTs = second(trackingData);
if (firstTs <= secondTs)
- newTrackingData = U.toLong((int)latestTs, secondTs);
+ newTrackingData = U.toLong((int)ts, secondTs);
else
- newTrackingData = U.toLong(firstTs, (int)latestTs);
+ newTrackingData = U.toLong(firstTs, (int)ts);
+
+ success = GridUnsafe.compareAndSwapLong(null, trackingPtr, trackingData, newTrackingData);
+ }
+ while (!success);
+ }
+
+ /** */
+ @Override protected void initPage(long pageId) {
+ int ts = (int)compactTimestamp(U.currentTimeMillis());
+
+ long trackingPtr = trackingArrPtr + trackingIdx(PageIdUtils.pageIndex(pageId)) * 8L;
- success = GridUnsafe.compareAndSwapLong(null, trackingArrPtr + trackingIdx * 8L, trackingData, newTrackingData);
- } while (!success);
+ GridUnsafe.compareAndSwapLong(null, trackingPtr, 0, U.toLong(ts, ts));
Review Comment:
`U.toLong(ts, 0)`?
--
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-28133 : Failure on cache.get() at the eviction v3 - CAS [ignite]
Posted by "asf-gitbox-commits (via GitHub)" <gi...@apache.org>.
asf-gitbox-commits closed pull request #12884: IGNITE-28133 : Failure on cache.get() at the eviction v3 - CAS
URL: https://github.com/apache/ignite/pull/12884
--
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org