Re: AtomicSequence not working when shutting down one server node from a cluster
Thanks. The issue got resolved. While starting the client I was not giving the configuration file.By setting the configuration file to client it solved the issue. But one for doubt I have. If I will run 2-3 client at the same time , then why the id being generated in each client has a diff of 1000. Means 1st client produces from 1 & 2nd from 1001 & 3rd from 2001. By this way it is not a sequence id genarator.Is there any configuration for that.So that the id will be a sequence across the cluster. -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p8008.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: AtomicSequence not working when shutting down one server node from a cluster
Hi, You example required external connection for running it and does not have atomicConfiguration, which was recommended. Hence I created own sample, please look at attachment. The example does not fail, until last one server would by online. PS You need to start ignite.sh with same configuration default-config.xml On Fri, Sep 23, 2016 at 1:46 PM, hitansu <hitansu...@gmail.com> wrote: > class org.apache.ignite.IgniteException: null > at > org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils. > java:908) > at > org.apache.ignite.internal.processors.datastructures. > GridCacheAtomicSequenceImpl.incrementAndGet(GridCacheAtomicSequenceImpl. > java:178) > at > ignite.IdGenerationServiceCacheLayer.getId(IdGenerationServiceCacheLayer. > java:61) > at > idgen_service.IdGenerationServiceDataLayer.generateId( > IdGenerationServiceDataLayer.java:56) > at client.IdGenTask.generateSequnceId(IdGenTask.java:43) > at client.IdGenTask.run(IdGenTask.java:33) > at java.lang.Thread.run(Thread.java:745) > Caused by: class org.apache.ignite.IgniteCheckedException: null > at > org.apache.ignite.internal.processors.cache.GridCacheUtils.outTx( > GridCacheUtils.java:921) > at > org.apache.ignite.internal.processors.datastructures. > GridCacheAtomicSequenceImpl.internalUpdate(GridCacheAtomicSequenceImpl. > java:255) > at > org.apache.ignite.internal.processors.datastructures. > GridCacheAtomicSequenceImpl.incrementAndGet(GridCacheAtomicSequenceImpl. > java:175) > ... 5 more > Caused by: java.lang.NullPointerException > at > org.apache.ignite.internal.processors.datastructures. > GridCacheAtomicSequenceImpl$2.call(GridCacheAtomicSequenceImpl.java:504) > at > org.apache.ignite.internal.processors.datastructures. > GridCacheAtomicSequenceImpl$2.call(GridCacheAtomicSequenceImpl.java:477) > at > org.apache.ignite.internal.processors.cache.GridCacheUtils$23.call( > GridCacheUtils.java:1672) > at > org.apache.ignite.internal.processors.cache.GridCacheUtils.outTx( > GridCacheUtils.java:915) > > > > -- > View this message in context: http://apache-ignite-users. > 70518.x6.nabble.com/AtomicSequence-not-working- > when-shutting-down-one-server-node-from-a-cluster-tp7770p7905.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. > -- Vladislav Pyatkov 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;> 127.0.0.1:47543..47550 Main.java Description: Binary data
Re: AtomicSequence not working when shutting down one server node from a cluster
class org.apache.ignite.IgniteException: null at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:908) at org.apache.ignite.internal.processors.datastructures.GridCacheAtomicSequenceImpl.incrementAndGet(GridCacheAtomicSequenceImpl.java:178) at ignite.IdGenerationServiceCacheLayer.getId(IdGenerationServiceCacheLayer.java:61) at idgen_service.IdGenerationServiceDataLayer.generateId(IdGenerationServiceDataLayer.java:56) at client.IdGenTask.generateSequnceId(IdGenTask.java:43) at client.IdGenTask.run(IdGenTask.java:33) at java.lang.Thread.run(Thread.java:745) Caused by: class org.apache.ignite.IgniteCheckedException: null at org.apache.ignite.internal.processors.cache.GridCacheUtils.outTx(GridCacheUtils.java:921) at org.apache.ignite.internal.processors.datastructures.GridCacheAtomicSequenceImpl.internalUpdate(GridCacheAtomicSequenceImpl.java:255) at org.apache.ignite.internal.processors.datastructures.GridCacheAtomicSequenceImpl.incrementAndGet(GridCacheAtomicSequenceImpl.java:175) ... 5 more Caused by: java.lang.NullPointerException at org.apache.ignite.internal.processors.datastructures.GridCacheAtomicSequenceImpl$2.call(GridCacheAtomicSequenceImpl.java:504) at org.apache.ignite.internal.processors.datastructures.GridCacheAtomicSequenceImpl$2.call(GridCacheAtomicSequenceImpl.java:477) at org.apache.ignite.internal.processors.cache.GridCacheUtils$23.call(GridCacheUtils.java:1672) at org.apache.ignite.internal.processors.cache.GridCacheUtils.outTx(GridCacheUtils.java:915) -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p7905.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: AtomicSequence not working when shutting down one server node from a cluster
This is the link to the code. https://github.com/hitansu/ScalableUniqueIdGenerator/tree/master/src/main/java <https://github.com/hitansu/ScalableUniqueIdGenerator/tree/master/src/main/java> client/IdGeneratorClient.java is the main class. 1. Started server nodes by executing the ignite.bat 2. The IdGeneratorClient.java runs as a client node 3. IdGenTask.java,which is a runnable, generates id Note: I am not using IgniteRunnable,which I think not necessary as the AtomicSequnce should run on all the server nodes by default. -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p7865.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: AtomicSequence not working when shutting down one server node from a cluster
Hi, For REPLICATED cache the property: is not matter. Could you please provide code sample, where the issue is reproduced? On Tue, Sep 20, 2016 at 10:33 AM, hitansu <hitansu...@gmail.com> wrote: > First of all why it is still showing this post is not accepted ? > I tried with the backup option & also tried with the REPLICATED mode cache > setting.Still it gives null poiter > when I stop one of the server(basically the first node).This is my cache > setting. > > > > > > > > > > -- > View this message in context: http://apache-ignite-users. > 70518.x6.nabble.com/AtomicSequence-not-working- > when-shutting-down-one-server-node-from-a-cluster-tp7770p7839.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. >
Re: AtomicSequence not working when shutting down one server node from a cluster
First of all why it is still showing this post is not accepted ? I tried with the backup option & also tried with the REPLICATED mode cache setting.Still it gives null poiter when I stop one of the server(basically the first node).This is my cache setting. -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p7839.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: AtomicSequence not working when shutting down one server node from a cluster
Even simpler and more correct is to increase a number of backups for AtomicConfiguration that is used for your sequence. This can be done by setting AtomicConfiguration.setBackups to value higher than 0. This will make your partitioned AtomicSequence fault tolerant unless all primaries and backups leave topology at the same time which is a rare situation. — Denis > On Sep 16, 2016, at 4:53 AM, Vladislav Pyatkov <vldpyat...@gmail.com> wrote: > > Hi, > > If you want so the cache will be replicated do this in > AtomicConfiguration.setCacheMode()[1]. > But it is not that by default, default is PARTITIONED cache, so you can loose > data in instability topology without backups. > > [1]: https://apacheignite.readme.io/docs/atomic-types#atomic-configuration > <https://apacheignite.readme.io/docs/atomic-types#atomic-configuration> > > On Fri, Sep 16, 2016 at 2:40 PM, hitansu <hitansu...@gmail.com > <mailto:hitansu...@gmail.com>> wrote: > Is it like replication ?But if the AtomicSequnce is cluster wide, then it > should work even one of the node is down.Isn't it?Why is it computing the > AtomicSequnce only in one node ? > > > > -- > View this message in context: > http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p7793.html > > <http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p7793.html> > Sent from the Apache Ignite Users mailing list archive at Nabble.com. > > > > -- > Vladislav Pyatkov
Re: AtomicSequence not working when shutting down one server node from a cluster
Is it like replication ?But if the AtomicSequnce is cluster wide, then it should work even one of the node is down.Isn't it?Why is it computing the AtomicSequnce only in one node ? -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p7793.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: AtomicSequence not working when shutting down one server node from a cluster
hitansu wrote > For my poc I created a cluster of 3 nodes by executing the ignite.bat file > 3 times.I run the java program as a client to generate sequence id.In the > middle I shut down one server node.The sequence id generation threw > NullpointerException.I observed that if the first server node is stopped > then only this problem is coming. > This means the atomic sequence is not being executed in all the server > nodes. You should add backups for atomic structures to make sure you're not losing the data in case of failures: AtomicConfiguration atomicCfg = new AtomicConfiguration(); atomicCfg.setBackups(1); Ignition.start(new IgniteConfiguration().setAtomicConfiguration(atomicCfg)); -Val -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p7782.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: AtomicSequence not working when shutting down one server node from a cluster
Hi, Please properly subscribe to the mailing list so that the community can receive email notifications for your messages. To subscribe, send empty email to user-subscr...@ignite.apache.org and follow simple instructions in the reply. -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p7779.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: AtomicSequence not working when shutting down one server node from a cluster
-- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/AtomicSequence-not-working-when-shutting-down-one-server-node-from-a-cluster-tp7770p7780.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.