You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by zshamrock <al...@gmail.com> on 2017/01/29 14:31:33 UTC

Affinity key backups mismatch (fix affinity key backups in cache configuration or set -DIGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK=true system property

I am trying to use Ignite AtomicLong, I've configured the XML according to
the official documentation:

<property name="atomicConfiguration">
            <bean
class="org.apache.ignite.configuration.AtomicConfiguration">
                <property name="backups" value="1"/>
            </bean>
</property>

Although when I run the application, I get the following exception, and
Ignite is failing to start:

org.apache.ignite.IgniteException: Affinity key backups mismatch (fix
affinity key backups in 
cache configuration or set
-DIGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK=true system property)
[cacheName=ignite-atomics-sys-cache, localAffinityKeyBackups=0,
remoteAffinityKeyBacku
ps=1, rmtNodeId=ffaee6a8-19b2-4168-8d9d-dafd4f9a1316]

I suppose Ignite atomics are implemented using the normal Ignite cache
underneath, although as we (as consumers) don't have access to this internal
cache, so I would expect Ignite will take care of the proper cache setup.
But instead I see the exception above.

Is it a bug in Ignite? And what does it mean and how it can be fixed? (yes,
setting  -DIGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK=true makes it work,
but also makes me feel uncomfortable about the approach).

Any ideas on this?

Using Ignite 1.7.0.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-key-backups-mismatch-fix-affinity-key-backups-in-cache-configuration-or-set-DIGNITE-SKIP-COy-tp10305.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Affinity key backups mismatch (fix affinity key backups in cache configuration or set -DIGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK=true system property

Posted by vkulichenko <va...@gmail.com>.
Hi,

Atomic configuration must be consistent on all nodes. As for general cache
configuration, you also must be consistent on all nodes if it's provided on
startup. However, it's ok if there is a configuration for a particular cache
only on client - it will distributed during cache start.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-key-backups-mismatch-fix-affinity-key-backups-in-cache-configuration-or-set-DIGNITE-SKIP-COy-tp10305p10318.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Affinity key backups mismatch (fix affinity key backups in cache configuration or set -DIGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK=true system property

Posted by zshamrock <al...@gmail.com>.
Or maybe then even more general question: which configuration should
be/enough configured where? Is it enough just to configure Ignite client
with AtomicConfiguration? What settings are enough to configure just on the
client side, which one on the server, and which one on both? I am little bit
lost. Is there a rule of thumb to follow?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-key-backups-mismatch-fix-affinity-key-backups-in-cache-configuration-or-set-DIGNITE-SKIP-COy-tp10305p10307.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Affinity key backups mismatch (fix affinity key backups in cache configuration or set -DIGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK=true system property

Posted by zshamrock <al...@gmail.com>.
Ok, I found the cause of the issue. It was the mismatch between the Ignite
client:

Ignition.setClientMode(true);
return Ignition.start(igniteConfiguration());

and ignite server running with XML configuration.

Which raises another question - how much in common in the configuration
Ignite client and Ignite server should have? And what would be the
consequences of not keeping them in sync?

As my Ignite server has extensive configuration for each of the cache used
with cachestore, eviction/expiry policies, etc. While my Ignite client
doesn't have anything related to the cache configuration at all, i.e. it is
simple like this:

@Bean
    public IgniteConfiguration igniteConfiguration() {
        final IgniteConfiguration igniteConfiguration = new
IgniteConfiguration();
        final AtomicConfiguration atomicConfiguration = new
AtomicConfiguration(); // 1
       
atomicConfiguration.setBackups(cacheEnvironment.atomicConfigurationBackups()); 
// 2
        igniteConfiguration.setAtomicConfiguration(atomicConfiguration); //
3
        igniteConfiguration.setGridName(cacheEnvironment.gridName());
        igniteConfiguration.setMetricsLogFrequency(0); // 0 - to disable
        setupTcpDiscoverySpi(igniteConfiguration);
        return igniteConfiguration;
    }

(by adding lines 1-3 has helped to solve the issue describe in the topic of
this thread)



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-key-backups-mismatch-fix-affinity-key-backups-in-cache-configuration-or-set-DIGNITE-SKIP-COy-tp10305p10306.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.