Ivan Veselovsky created IGNITE-863:
--------------------------------------
Summary: IgniteCache#put() deadly hangs with FileSwapSpaceSpi if
maxWriteQueueSize < writeBufSize
Key: IGNITE-863
URL: https://issues.apache.org/jira/browse/IGNITE-863
Project: Ignite
Issue Type: Bug
Reporter: Ivan Veselovsky
Consider cache configuration:
{code}
<property name="swapSpaceSpi">
<bean class="org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi">
<property name="baseDirectory" value="/tmp/foo"/>
<property name="maxWriteQueueSize" value="10000"/>
</bean>
</property>
{code}
This configuration has {code}writeBufSize == 65536{code} (default).
After that I do add cache.put(i,i), where i is consequent long numbers.
After number of entries gets larger than evictionPolicy#maxSize, the #put()
method hangs deadly.
Thread dump shows that swap writer and putting thread both wait for conditions
related to write queue size:
{code}
"Swap writer: gg-swap-cache-dflt-#9%null" prio=10 tid=0x00007f8dec008000
nid=0x5c43 waiting on condition [0x00007f8d3dbda000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007ad513020> (a
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at
org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi$SwapValuesQueue.take(FileSwapSpaceSpi.java:847)
at
org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi$Space$1$1.body(FileSwapSpaceSpi.java:1439)
at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)
"put-thread-5" prio=10 tid=0x00007f8de4009800 nid=0x5c41 waiting on condition
[0x00007f8d3dddb000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007ad513008> (a
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at
org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi$SwapValuesQueue.add(FileSwapSpaceSpi.java:819)
at
org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi$Space.store(FileSwapSpaceSpi.java:1631)
at
org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi.store(FileSwapSpaceSpi.java:434)
at
org.apache.ignite.internal.managers.swapspace.GridSwapSpaceManager.write(GridSwapSpaceManager.java:190)
at
org.apache.ignite.internal.processors.cache.GridCacheSwapManager.writeToSwap(GridCacheSwapManager.java:1092)
at
org.apache.ignite.internal.processors.cache.GridCacheSwapManager.write(GridCacheSwapManager.java:1015)
at
org.apache.ignite.internal.processors.cache.GridCacheMapEntry.swap(GridCacheMapEntry.java:523)
at
org.apache.ignite.internal.processors.cache.GridCacheMapEntry.evictInternal(GridCacheMapEntry.java:3623)
- locked <0x00000007ad330460> (a
org.apache.ignite.internal.processors.cache.local.GridLocalCacheEntry)
at
org.apache.ignite.internal.processors.cache.GridCacheEvictionManager.evict0(GridCacheEvictionManager.java:669)
at
org.apache.ignite.internal.processors.cache.GridCacheEvictionManager.evict(GridCacheEvictionManager.java:901)
at
org.apache.ignite.internal.processors.cache.CacheEvictableEntryImpl.evict(CacheEvictableEntryImpl.java:67)
at
org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy.shrink(FifoEvictionPolicy.java:208)
at
org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy.onEntryAccessed(FifoEvictionPolicy.java:139)
at
org.apache.ignite.internal.processors.cache.GridCacheEvictionManager.notifyPolicy(GridCacheEvictionManager.java:1340)
at
org.apache.ignite.internal.processors.cache.GridCacheEvictionManager.touch(GridCacheEvictionManager.java:783)
at
org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache.updateAllInternal(GridLocalAtomicCache.java:933)
at
org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache.put(GridLocalAtomicCache.java:122)
at
org.apache.ignite.internal.processors.cache.GridCacheAdapter.put(GridCacheAdapter.java:1994)
at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy.put(IgniteCacheProxy.java:831)
at
org.gridgain.grid.spi.swapspace.zs.SanDiskZsSwapLoadTest$3.applyx(SanDiskZsSwapLoadTest.java:232)
at
org.apache.ignite.internal.util.lang.GridAbsClosureX.apply(GridAbsClosureX.java:35)
at
org.apache.ignite.internal.util.lang.GridAbsClosure.run(GridAbsClosure.java:50)
at
org.apache.ignite.testframework.GridTestUtils$7.call(GridTestUtils.java:909)
at
org.apache.ignite.testframework.GridTestThread.run(GridTestThread.java:86)
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)