These are chat archives for atomix/atomix

Jan 2017
Jan 07 2017 07:21
@kuujo Thanks a lot for explaining it thoroughly. It makes perfect sense. I will try this later and let you know. I was using a slightly modified version of code copied from I didn't realise the code snippets had to be run from different threads.
Jan 07 2017 07:32
@kuujo Brilliant! It (calling join later after bootstrapping all 3 replicas) worked, thanks.
Jan 07 2017 07:37
@kuujo I am planning to use atomix in a clustered web app to synchronise changes to a java keystore (not very intuitive I know) among instances. I will have to bother you with more questions shortly :) I hope it's okay to ask questions here.
Jordan Halterman
Jan 07 2017 07:39
Good point about the documentation. We should probably clarify that a replica can't start without being able to communicate with a majority of the cluster at startup.
And questions are what this chat is for! Mostly. Well, it's a mix of questions and general development work
Jan 07 2017 17:16
@kuujo I am getting a "java.lang.IllegalStateException: cannot complete locked snapshot descriptor" error. Does that bring anything obvious to your mind? I will try my best to explain what I am doing.
I am running two instances of a web application both starting two replicas on different ports (host is localhost)
I am using the publish subscribe model to synchronize keys using messages
The first instance starts successfully and I can see the poll logs
No errors there
The second instance when started logs that it found the leader (first instance), then this exception is being thrown continuosly
Both instances create/join a group and subscribe to messages
Jan 07 2017 17:21
I haven't used any storage or transport configuration. both are default. AtomixReplica.builder(new Address("localhost", clusterConfig.getPort())).build()
If it's of any help, this is the relevant log entry:
Jan 07 2017 17:26
2017-01-07 22:39:12.892  INFO 16453 --- [.1:8701-copycat] i.a.copycat.server.state.ServerContext   : localhost/ - Found leader localhost/
2017-01-07 22:39:12.990  INFO 16453 --- [.1:8701-copycat] i.a.c.server.state.ServerStateMachine    : localhost/ - Taking snapshot 1
2017-01-07 22:39:13.094 ERROR 16453 --- [.1:8701-copycat] i.a.c.u.concurrent.SingleThreadContext   : An uncaught exception occurred

java.lang.IllegalStateException: cannot complete locked snapshot descriptor
    at io.atomix.catalyst.util.Assert.state( ~[catalyst-serializer-1.0.7.jar:na]
    at io.atomix.catalyst.util.Assert.stateNot( ~[catalyst-serializer-1.0.7.jar:na]
    at ~[copycat-server-1.0.0-rc7.jar:na]
    at io.atomix.copycat.server.state.ServerStateMachine.completeSnapshot( ~[copycat-server-1.0.0-rc7.jar:na]
    at io.atomix.copycat.server.state.ServerStateMachine.setLastCompleted( ~[copycat-server-1.0.0-rc7.jar:na]
    at io.atomix.copycat.server.state.ServerStateMachine.lambda$registerSession$71( ~[copycat-server-1.0.0-rc7.jar:na]
    at io.atomix.catalyst.util.concurrent.Runnables.lambda$logFailure$17( ~[catalyst-common-1.0.7.jar:na]
    at java.util.concurrent.Executors$ ~[na:1.8.0_101]
    at ~[na:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201( ~[na:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ ~[na:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor.runWorker( ~[na:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor$ ~[na:1.8.0_101]
    at ~[na:1.8.0_101]
Please see the subscriber code below:
    public void listenForNewKeys() {
        atomix.getReplica().thenAccept(replica -> {

            replica.getGroup("group").thenAccept(group -> {
                // Join the group and block until the join is complete
                LocalMember localMember = group.join().join();

                // Create a message consumer and ack messages when received for
                // this member
                MessageConsumer<String> consumer = localMember.messaging().consumer("events");
                consumer.onMessage(message -> {
                    String messageValue = message.message();
                    KeyCreated keyCreated = KeyCreated.fromJson(messageValue);
                    SecretKey key = getKeyFromString(keyCreated.getEncodedKey());
                    saveKey(keyCreated.getKeyAlias(), key);
Thiago Santos
Jan 07 2017 20:13
Didn't reproduce the log entry mismatch but got the client to get stuck in the same way due to sequence numbers. Reading the logs to see why exactly it got stuck
Thiago Santos
Jan 07 2017 21:40
Actually it might still be applying different entries at the same index