[
https://issues.apache.org/jira/browse/IGNITE-28133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vladimir Steshin updated IGNITE-28133:
--------------------------------------
Attachment: GetFailureAtEvictionReproducerTest.java
> Failure on cache.get() at the eviction.
> ---------------------------------------
>
> Key: IGNITE-28133
> URL: https://issues.apache.org/jira/browse/IGNITE-28133
> Project: Ignite
> Issue Type: Improvement
> Reporter: Vladimir Steshin
> Priority: Major
> Attachments: GetFailureAtEvictionReproducerTest.java,
> reproduce_helper.patch
>
>
> When the eviction enabled on an in-memory cache, an assertion may apper in
> paraller get() operation:
> {code:java}
> Caused by: java.lang.AssertionError: [link=337503] at
> org.apache.ignite.internal.processors.cache.persistence.evict.RandomLruPageEvictionTracker.getFragmentLink(RandomLruPageEvictionTracker.java:193)
> at
> org.apache.ignite.internal.processors.cache.persistence.evict.PageAbstractEvictionTracker.tailPageTrackingIdx(PageAbstractEvictionTracker.java:212)
> at
> org.apache.ignite.internal.processors.cache.persistence.evict.PageAbstractEvictionTracker.trackFragmentPage(PageAbstractEvictionTracker.java:199)
> at
> org.apache.ignite.internal.processors.cache.persistence.freelist.AbstractFreeList$WriteRowHandler.addRow(AbstractFreeList.java:215)
> at
> org.apache.ignite.internal.processors.cache.persistence.freelist.AbstractFreeList$WriteRowHandler.run(AbstractFreeList.java:172)
> at
> org.apache.ignite.internal.processors.cache.persistence.freelist.AbstractFreeList$WriteRowHandler.run(AbstractFreeList.java:159)
> at
> org.apache.ignite.internal.processors.cache.persistence.tree.util.PageHandler.writePage(PageHandler.java:313)
> at
> org.apache.ignite.internal.processors.cache.persistence.DataStructure.write(DataStructure.java:371)
> at
> org.apache.ignite.internal.processors.cache.persistence.freelist.AbstractFreeList.writeSinglePage(AbstractFreeList.java:714)
> at
> org.apache.ignite.internal.processors.cache.persistence.freelist.AbstractFreeList.insertDataRow(AbstractFreeList.java:603)
> at
> org.apache.ignite.internal.processors.cache.persistence.freelist.CacheFreeList.insertDataRow(CacheFreeList.java:74)
> at
> org.apache.ignite.internal.processors.cache.persistence.freelist.CacheFreeList.insertDataRow(CacheFreeList.java:35)
> at
> org.apache.ignite.internal.processors.cache.persistence.RowStore.addRow(RowStore.java:110)
> at
> org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.createRow(IgniteCacheOffheapManagerImpl.java:1541)
> at
> org.apache.ignite.internal.processors.cache.GridCacheMapEntry$AtomicCacheUpdateClosure.update(GridCacheMapEntry.java:5059)
> at
> org.apache.ignite.internal.processors.cache.GridCacheMapEntry$AtomicCacheUpdateClosure.call(GridCacheMapEntry.java:4785)
> at
> org.apache.ignite.internal.processors.cache.GridCacheMapEntry$AtomicCacheUpdateClosure.call(GridCacheMapEntry.java:4470)
> at
> org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Invoke.invokeClosure(BPlusTree.java:3941)
> at
> org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.invokeDown(BPlusTree.java:2247)
> at
> org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.invoke(BPlusTree.java:2137)
> {code}
>
> This happens because _IgniteCacheOffheapManagerImpl_ does unprotected (with
> no {_}readLock(){_}):
> {code:java}
> PageEvictionTracker#touchPage(long pageId):{code}
> {code:java}
> private void afterRowFound(@Nullable CacheDataRow row, KeyCacheObject key)
> throws IgniteCheckedException {
> if (row != null) {
> row.key(key);
> grp.dataRegion().evictionTracker().touchPage(row.link());
> }
> }{code}
>
> To reproduce, I had to use (see the reproduce heper patch appached):
> {code:java}
> private void afterRowFound(@Nullable CacheDataRow row, KeyCacheObject key)
> throws IgniteCheckedException {
> if (row != null) {
> row.key(key);
> // Reproduce helper cycle. Increase the iteration number to get
> higher concurrecy chance.
> for (int i = 0; i < 1000000; ++i)
> grp.dataRegion().evictionTracker().touchPage(row.link());
> }
> } {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)