You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Bartłomiej Stefański (Jira)" <ji...@apache.org> on 2019/10/18 15:45:00 UTC

[jira] [Comment Edited] (IGNITE-12142) Ignite ignores that on-heap store is disabled when putting values through near cache

    [ https://issues.apache.org/jira/browse/IGNITE-12142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16954677#comment-16954677 ] 

Bartłomiej Stefański edited comment on IGNITE-12142 at 10/18/19 3:44 PM:
-------------------------------------------------------------------------

[~dmagda] I've done some debugging today. From what I found:

-if near cache is created then reader is added to server.- each entry added by near cache to cache have a reader on server.  Server node uses reader to update near cache when value is changed on server. 



During eviction, Ignite invokes this line: [https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java#L4598]

So, when near cache is enabled condition will be evaluated to false, because reader exists. That is why eviction do not remove entries from cache.

Can you confirm that what I wrote is true? Is it a bug? Do you plan to fix it?


was (Author: bstefanski):
[~dmagda] I've done some debugging today. From what I found:

if near cache is created then reader is added to server. Server node uses reader to update near cache when value is changed on server.

During eviction, Ignite invokes this line: [https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java#L4598]

So, when near cache is enabled condition will be evaluated to false, because reader exists. That is why eviction do not remove entries from cache.

Can you confirm that what I wrote is true? Is it a bug? Do you plan to fix it?

> Ignite ignores that on-heap store is disabled when putting values through near cache
> ------------------------------------------------------------------------------------
>
>                 Key: IGNITE-12142
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12142
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 2.7, 2.7.5
>            Reporter: Bartłomiej Stefański
>            Priority: Major
>
> I have an Ignite cluster that consists of two nodes:
> * @n0 - server node
> * @n1 - client node
> Installed PARTITIONED cache {{myCache}} on both of them. Cache has near cache on client node and disabled on-heap caching on server.
> Server configuration:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
>        http://www.springframework.org/schema/beans/spring-beans.xsd">
>     <bean class="org.apache.ignite.configuration.IgniteConfiguration">
>         <property name="clientMode" value="false"/>
>         <property name="cacheConfiguration">
>             <list>
>                 <bean class="org.apache.ignite.configuration.CacheConfiguration">
>                     <property name="name" value="myCache"/>
>                     <property name="cacheMode" value="PARTITIONED"/>
>                     <property name="onheapCacheEnabled" value="false"/>
>                 </bean>
>             </list>
>         </property>
>     </bean>
> </beans>
> {code}
> Client configuration:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
>        http://www.springframework.org/schema/beans/spring-beans.xsd">
>     <bean class="org.apache.ignite.configuration.IgniteConfiguration">
>         <property name="clientMode" value="true"/>
>         <property name="cacheConfiguration">
>             <list>
>                 <bean class="org.apache.ignite.configuration.CacheConfiguration">
>                     <property name="name" value="myCache"/>
>                     <property name="cacheMode" value="PARTITIONED"/>
>                     <property name="onheapCacheEnabled" value="false"/>
>                     <property name="nearConfiguration">
>                         <bean class="org.apache.ignite.configuration.NearCacheConfiguration">
>                             <property name="nearEvictionPolicy">
>                                 <bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
>                                     <property name="maxSize" value="1000"/>
>                                 </bean>
>                             </property>
>                         </bean>
>                     </property>
>                 </bean>
>             </list>
>         </property>
>     </bean>
> </beans>
> {code}
> I have noticed (using visor) strange cache state after putting 20k entries to that cache through client node (@n1):
> {code}
> +======================================================================================================================+
> |      Node ID8(@), IP      | CPUs | Heap Used | CPU Load |   Up Time    |    Size (Primary / Backup)    | Hi/Mi/Rd/Wr |
> +======================================================================================================================+
> | 99E64885(@n0), 172.17.0.1 | 4    | 2.56 %    | 0.50 %   | 00:02:47.615 | Total: 40000 (40000 / 0)      | Hi: 0       |
> |                           |      |           |          |              |   Heap: 20000 (20000 / <n/a>) | Mi: 0       |
> |                           |      |           |          |              |   Off-Heap: 20000 (20000 / 0) | Rd: 0       |
> |                           |      |           |          |              |   Off-Heap Memory: <n/a>      | Wr: 0       |
> +---------------------------+------+-----------+----------+--------------+-------------------------------+-------------+
> | FE7BEE4F(@n1), 172.17.0.1 | 4    | 3.89 %    | 3.10 %   | 00:02:37.269 | Total: 1000 (1000 / 0)        | Hi: 0       |
> |                           |      |           |          |              |   Heap: 1000 (1000 / <n/a>)   | Mi: 0       |
> |                           |      |           |          |              |   Off-Heap: 0 (0 / 0)         | Rd: 0       |
> |                           |      |           |          |              |   Off-Heap Memory: 0          | Wr: 0       |
> +----------------------------------------------------------------------------------------------------------------------+
> {code}
> Why Ignite stores entries on heap space on server node? If I put 20k entries through server node then server on-heap space is not used:
> {code}
> +======================================================================================================================+
> |      Node ID8(@), IP      | CPUs | Heap Used | CPU Load |   Up Time    |    Size (Primary / Backup)    | Hi/Mi/Rd/Wr |
> +======================================================================================================================+
> | 9C1D895B(@n0), 172.17.0.1 | 4    | 1.68 %    | 0.43 %   | 00:15:44.149 | Total: 20000 (20000 / 0)      | Hi: 0       |
> |                           |      |           |          |              |   Heap: 0 (0 / <n/a>)         | Mi: 0       |
> |                           |      |           |          |              |   Off-Heap: 20000 (20000 / 0) | Rd: 0       |
> |                           |      |           |          |              |   Off-Heap Memory: <n/a>      | Wr: 0       |
> +---------------------------+------+-----------+----------+--------------+-------------------------------+-------------+
> | 5059A9F2(@n1), 172.17.0.1 | 4    | 2.05 %    | 0.00 %   | 00:15:37.410 | Total: 0 (0 / 0)              | Hi: 0       |
> |                           |      |           |          |              |   Heap: 0 (0 / <n/a>)         | Mi: 0       |
> |                           |      |           |          |              |   Off-Heap: 0 (0 / 0)         | Rd: 0       |
> |                           |      |           |          |              |   Off-Heap Memory: 0          | Wr: 0       |
> +----------------------------------------------------------------------------------------------------------------------+
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)