These are chat archives for atomix/atomix

4th
Apr 2018
Johno Crawford
@johnou
Apr 04 2018 00:42
23:30:05.478 [atomix-cluster-heartbeat-receiver] ERROR i.a.c.impl.DefaultClusterService - Uncaught exception on atomix-cluster-heartbeat-receiver
com.esotericsoftware.kryo.KryoException: Buffer underflow.
Serialization trace:
identifier (io.atomix.cluster.NodeId)
nodeId (io.atomix.cluster.impl.ClusterHeartbeat)
    at com.esotericsoftware.kryo.io.Input.require(Input.java:199) ~[kryo-4.0.1.jar:na]
    at com.esotericsoftware.kryo.io.Input.readAscii_slow(Input.java:616) ~[kryo-4.0.1.jar:na]
    at com.esotericsoftware.kryo.io.Input.readAscii(Input.java:594) ~[kryo-4.0.1.jar:na]
    at com.esotericsoftware.kryo.io.Input.readString(Input.java:472) ~[kryo-4.0.1.jar:na]
    at com.esotericsoftware.kryo.serializers.DefaultSerializers$StringSerializer.read(DefaultSerializers.java:199) ~[kryo-4.0.1.jar:na]
    at com.esotericsoftware.kryo.serializers.DefaultSerializers$StringSerializer.read(DefaultSerializers.java:188) ~[kryo-4.0.1.jar:na]
    at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.1.jar:na]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.1.jar:na]
    at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:543) ~[kryo-4.0.1.jar:na]
checking this out
Jordan Halterman
@kuujo
Apr 04 2018 00:51
Yeah I think there is a lot of usability stuff that needs to be improved after the configuration PR
@johnou that looks like a polling issue
pooling* stupid autocorrect
Johno Crawford
@johnou
Apr 04 2018 00:52
yes
i'd like to know why though
Jordan Halterman
@kuujo
Apr 04 2018 00:53
IMO getting useful error messages in the code is going to be important to making it usable - e.g. when a user tries to create a Raft primitive in a cluster that doesn’t have any Raft partitions, or when the configuration is malformed, etc
Johno Crawford
@johnou
Apr 04 2018 00:55
    if (inputStream == null) return -1;
i see
Jordan Halterman
@kuujo
Apr 04 2018 00:59

@aaudiber we actually did this in ONOS to migrate state from old Raft partitions to new partitions. You can still join as a non-voting member, we just removed the member types:

RaftServer server = RaftServer.builder()...build();
server.listen(members).join();

I did a little work on the cluster configuration in 2.x but the principle is the same: join() adds an active member and listen() adds a passive member.

Andrew Audibert
@aaudiber
Apr 04 2018 01:00
thanks! listen() is what I was looking for
Jordan Halterman
@kuujo
Apr 04 2018 01:00
So, we copied Raft partitions by listen()ing and then leaving the cluster after startup completed, deleted some configuration files, then formed a new cluster
:+1:
Johno Crawford
@johnou
Apr 04 2018 01:02
that should do it
Jordan Halterman
@kuujo
Apr 04 2018 01:07

FYI massive configuration PR incoming. I have no idea how big it is yet, but it’s... BIG.

I basically had to create Java beans for everything that’s configurable - the cluster, core/bootstrap nodes, partition groups, primitives, primitive types, primitive protocols, serializers - then added some extension mechanisms with ServiceLoader to be able to dynamically map polymorphic types for all the implementations. But the result is that the entire cluster can be configured, including primitives, primitive types, serializers, agents, and anything else that uses the builder pattern.

https://github.com/atomix/atomix/blob/config/agent/src/test/resources/atomix.yaml

Also supports either YAML or JSON, so some things can also be configured via the REST API (as long as it’s not a security risk).

You can also mix and match the two, so e.g. the AtomixAgentTest uses a single configuration file for the entire cluster and just passes the local node information to each builder, so the same configuration can be reused:
https://github.com/atomix/atomix/blob/config/agent/src/test/java/io/atomix/agent/AtomixAgentTest.java
Also, there’s no dependency on Jackson unless you include the atomix-config jar on the classpath
Johno Crawford
@johnou
Apr 04 2018 01:11
make sure you include the bom with version 2.9.5
there are a couple of vulnerabilities that have been fixed
Jordan Halterman
@kuujo
Apr 04 2018 01:14
I know of one… but it only applies to using @class or JsonTypeInfo.Id.CLASS
which requires an option to be enabled on the ObjectMapper
Johno Crawford
@johnou
Apr 04 2018 01:15
iirc there is one in 2.9.4 where if you use c3p0 can spell trouble
then again, not sure how many people use that now adays :)
Jordan Halterman
@kuujo
Apr 04 2018 01:17
done
Johno Crawford
@johnou
Apr 04 2018 01:18
looks good
Johno Crawford
@johnou
Apr 04 2018 01:27
@kuujo so why does DefaultDocumentTreeTest hang so often and not blow up?
Jordan Halterman
@kuujo
Apr 04 2018 01:27
I noticed that too
something wrong with that thing
Jordan Halterman
@kuujo
Apr 04 2018 01:42
Travis gets a lot of failures that I don’t get locally, but I have learned running the tests directly via Maven often reproduces them, so as we get closer I’ll go through the periodically failing tests and try to reproduce and debug themes
them*
Johno Crawford
@johnou
Apr 04 2018 02:09
@kuujo finally green (pooled pr)
time for bed :)
abeep
@abeep
Apr 04 2018 02:52
@kuujo Thanks example link is not working https://github.com/atomix/atomix/tree/master/examples, anyway will give it a try, on the other question regarding Write-behind can you give some pointers on the implementation?
Johno Crawford
@johnou
Apr 04 2018 11:24
@kuujo I think the original implementation where ByteArrayOutputStream was pooled is actually more robust
so i'll revert to that and let you know when it's good to go
abeep
@abeep
Apr 04 2018 12:38
@kuujo , write-behind thinking of modifying ConsistentMapService, any other suggestions, planing to put a abstract datatore
no puttAll support?, is this feature coming in 2.1
Johno Crawford
@johnou
Apr 04 2018 13:23
no put all doesn't exist in master
feel free to submit a pull request
@kuujo should be good to go, we are running the same input / output code in production now with no buffer over or under flow
Jordan Halterman
@kuujo
Apr 04 2018 18:13
Sweet
@abeep feel free to send a PR. Adding operations to primitives should be pretty straightforward - there are a ton of examples
For putAll I mean
Generally, the pattern used for adding behaviors like write-behind is to create a wrapper class (e.g. CachingAsyncConsistentMap, add some options to the builder, and update the proxy builder to wrap the low level instance.
Johno Crawford
@johnou
Apr 04 2018 19:24
@kuujo I split the changes into two pull requests, easier to review now I think
atomix/atomix#476
atomix/atomix#458
Johno Crawford
@johnou
Apr 04 2018 23:00
@kuujo shouldn't the data dir be per node
We have multiple services per node which should be configured to use different data directories, no?
Johno Crawford
@johnou
Apr 04 2018 23:14
Ah of course nvm, it isn't a shared config