Thanks Denis,

The version is 2.5 and we are indeed using persistence. Full config
attached.

Another weird thing that happened is that after restarting the node a few
time it starts properly and joins the cluster. However, when I try to
create a SQL table (from spark) using template "ga_template" (defined in
the config) I get the error *Cache doesn't exist. *After some time, with
the same code and settings, creating the table starts working.

I know it sounds odd, but I have observed both a few times.

Based on the link you sent, the node Id should be automatically picked up
from the name of the file in persistence directory. Is it possible that the
pst lock was not being released properly, so when the node was restarted it
tried to create a new UUID?

Cheers,
Eugene

On Fri, Aug 31, 2018 at 1:57 AM Denis Magda <dma...@apache.org> wrote:

> Strange, I've never seen consistent IDs collisions before. Are you using
> Ignite persistence and what's your version? If you scroll to the end of
> this paragraph, you'll find an explanation on how the IDs are generated:
>
> https://apacheignite.readme.io/docs/distributed-persistent-store#section-usage
>
> --
> Denis
>
> On Thu, Aug 30, 2018 at 9:10 PM eugene miretsky <eugene.miret...@gmail.com>
> wrote:
>
>> Hello,
>>
>> Is it possible to set a nodeId when restarting a node? How is the id
>> generated?
>>
>> Sometimes after the cluster crashes, when I restart a node I get the
>> following error: Caused by: class
>> org.apache.ignite.spi.IgniteSpiException: Failed to add node to topology
>> because it has the same hash code for partitioned affinity as one of
>> existing nodes [cacheName=SQL_PUBLIC_GAL3EC2,
>> existingNodeId=598e3ead-99b8-4c49-b7df-04d578dcbf5f]
>>
>> It looks like the node is trying to start with another nodeId, and cannot
>> because it's old nodeId owns the same partitions.
>>
>> Cheers,
>> Eugene
>>
>
<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<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";>
    <!--
        Alter configuration below as needed.
    -->

    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="igniteInstanceName" value="Server"/>
<property name="gridLogger">
    <bean class="org.apache.ignite.logger.log4j.Log4JLogger">
      <constructor-arg type="java.lang.String" value="ignite-log4j.xml"/>
    </bean>
  </property>
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.zk.ZookeeperDiscoverySpi">
                <property name="zkConnectionString" value="172.21.85.10:2181,172.21.85.11:2181,172.21.86.10:2181"/>
                <property name="sessionTimeout" value="30000"/>
                <property name="zkRootPath" value="/apacheIgnite"/>
                <property name="joinTimeout" value="10000"/>
            </bean>
        </property>

        <property name="dataStorageConfiguration">
            <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
                        <property name="writeThrottlingEnabled" value="true"/>
			<property name="walPath" value="/ignite_data/wal"/>
			<property name="walArchivePath" value="/ignite_data/wal/archive"/>
			<property name="storagePath" value="/ignite_data/persistence"/>
		        <property name="pageSize" value="#{4 * 1024}"/>
                <property name="defaultDataRegionConfiguration">
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name="initialSize" value="#{32L * 1024 * 1024 * 1024}"/>
                        <property name="maxSize" value="#{130L * 1024 * 1024 * 1024}"/>
                        <property name="metricsEnabled" value="true"/>
                        <property name="persistenceEnabled" value="true"/>
                        <property name="checkpointPageBufferSize" value="#{1024L * 1024 * 1024}"/>
                    </bean>
                </property>
            </bean>
        </property>

        <property name="cacheConfiguration">
            <list>
                <bean parent="cache-template">
                    <property name="name" value="ga_template*"/>
                    <property name="cacheMode" value="PARTITIONED"/>
                    <property name="atomicityMode" value="ATOMIC"/>
                    <property name="copyOnRead" value="true"/>
                    <property name="queryDetailMetricsSize" value="10"/>
                    <property name="queryParallelism" value="32"/>
                    <property name="statisticsEnabled" value="true"/>
                    <property name="managementEnabled" value="true"/>
                </bean>
            </list>
        </property>
    <property name="transactionConfiguration">
        <bean class="org.apache.ignite.configuration.TransactionConfiguration">
        <property name="TxTimeoutOnPartitionMapExchange" value="20000"/>
        </bean>
    </property>
    </bean>
 <bean id="cache-template" abstract="true" class="org.apache.ignite.configuration.CacheConfiguration">
        <property name="rebalanceMode" value="SYNC"/>
        <property name="writeSynchronizationMode" value="FULL_SYNC"/>
        <property name="backups" value="0"/>
        <property name="eagerTtl" value="true"/>
    </bean>
</beans>

Reply via email to