1
votes

I run an example with two ignite cache node in two jvm. each jvm runs a ignite node. the nodes map to the same cache.

ignite-config.xml

<bean class="org.apache.ignite.configuration.IgniteConfiguration">
    ...
    <property name="cacheConfiguration">
        <bean class="org.apache.ignite.configuration.CacheConfiguration">
            <!-- Set a cache name. -->
            <property name="name" value="cacheName"/>
            <!-- Set cache mode. -->
            <property name="cacheMode" value="PARTITIONED"/>
            <!-- Number of backup nodes. -->
            <property name="backups" value="1"/>
            ... 
        </bean>
    </property>
</bean>

test steps:

  1. one of the ignite nodes start first and write 10 pieces of data(key-value: 1-1,2-2,3-3...10-10).
  2. then the second one start and map to the cache.
  3. then ignite nodes start to rebalancing data for them. the first node has 4 pieces, the second has 6 pieces.
  4. then i kill the jvm of first cache node.

result: the backup node doesn't own 10 pieces as i expect.why?

1
This should not happen. How do you check which entries are owned by which nodes? Can you show the test code?Valentin Kulichenko
@Valentin i use the ignitevisorcmd.sh,it offer a cmd:cache -swap and cache -scan -c=@c0 -id8=@n0Michael Jul
Did you try querying the cache after you kill the one node? Or did you just use the ignitevisorcmd.sh. It could be a bug in the monitoring software as well so you should test if it has the keys after by querying. (Not likely, but a possibility) Does it make it difference which node you kill?Carlos Bribiescas
@CarlosBribiescas maybe,i will test it tomorrow. do you test it before?can you give me an example it really works.Michael Jul
cache -scan shows only primary entries I think. What IgniteCache.size() returns after the node is killed?Valentin Kulichenko

1 Answers

0
votes

I'm not sure why ignitevisorcmd.sh is reporting the keys are lost. I suggest looking directly into the cache by querying it after you kill the node. Or as Valentin Suggests, you can try IgniteCache.size()