These are chat archives for atomix/atomix

29th
May 2018
Johno Crawford
@johnou
May 29 2018 08:25
@rroller yeah that's the project I found when looking it up
oh and git reflog ftw
Jordan Halterman
@kuujo
May 29 2018 09:35
was a holiday in the US today but I’ll be back at it in the morning
PR still needs a little bit of work and then some testing in ONOS tomorrow
Johno Crawford
@johnou
May 29 2018 15:57
@kuujo can you hook me up with permissions for documentation?
ERROR: Permission to atomix/atomix.github.io.git denied to johnou.
Jordan Halterman
@kuujo
May 29 2018 17:52
indeed
Ronnie
@rroller
May 29 2018 20:12
my smoke test fails now
io.atomix.utils.config.ConfigurationException: Failed to load class: io.atomix.protocols.backup.partition.PrimaryBackupPartitionGroupFactory
    at io.atomix.utils.config.ConfigMapper.getValue(ConfigMapper.java:264)
this is the same unit test i've been using to make sure there's no breaking changes... any idea what's going on there?
it's actually this that causes it Atomix.builder();
that single line will fail
Ronnie
@rroller
May 29 2018 20:18
This will fix it Atomix.builder(new AtomixConfig()); though it seems like a bug with the raw builder(); But then I run into a new issue
io.atomix.utils.config.ConfigurationException: Unknown partition group type raft
Jordan Halterman
@kuujo
May 29 2018 20:21
Atomix.builder(new AtomixConfig()) is not safe because then it doesn’t load any of the classes that need to be registered
some sort of classpath issue
Ronnie
@rroller
May 29 2018 20:22
hmm
i was trying this
        final Atomix atomix = Atomix.builder(new AtomixConfig())
                .withManagementGroup((RaftPartitionGroup.builder("system")
                        .withNumPartitions(1)
                        .withMembers(membersArr)
                        .withDataDirectory(dataDir)
                        .build()))
                .withPartitionGroups(RaftPartitionGroup.builder("raft")
                        .withNumPartitions(1)
                        .withMembers(membersArr)
                        .withDataDirectory(dataDir)
                        .build())
                .withMembers(membersArr)
                .withLocalMember(local)
                .withClusterName("Cluster name")
                .build();
i get the raft error
if i remove new AtomixConfig() i get the other error
Jordan Halterman
@kuujo
May 29 2018 20:24
hmm
Ronnie
@rroller
May 29 2018 20:24
let me see what deps i have
      <dependency>
        <groupId>io.atomix</groupId>
        <artifactId>atomix</artifactId>
        <version>2.1.0-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>io.atomix</groupId>
        <artifactId>atomix-raft</artifactId>
        <version>2.1.0-SNAPSHOT</version>
      </dependency>
do i need any others?
Jordan Halterman
@kuujo
May 29 2018 20:25
no
lemme look around at the snapshot
I’m guessing that configuration file is not in the jar
Ronnie
@rroller
May 29 2018 20:26
k, it fails on my desktop and in our build system, the build system is ephemeral so it redownloads artifacts each time
Jordan Halterman
@kuujo
May 29 2018 20:29
it’s there
Hmm actually there’s a small bug but I don’t suspect it will make a difference
Ronnie
@rroller
May 29 2018 20:32
anything else i can send to help debug?
I can paste my full test if you like
(but I guess that doesn't help if it's a classpath issue)
what version of lightbend do i need? I also use lightbend in my app, maybe that's causing an issue if I have a different version
Jordan Halterman
@kuujo
May 29 2018 20:42
it’s on 1.3.2
basically it’s just calling https://github.com/atomix/atomix/blob/typesafe-config/utils/src/main/java/io/atomix/utils/config/ConfigMapper.java#L77-L87 with the arguments atomix.conf, atomix.json, atomix.properties, defaults.conf
when you use Atomix.builder()
Ronnie
@rroller
May 29 2018 20:43
so am i doing something wrong?
Jordan Halterman
@kuujo
May 29 2018 20:44
hmm actually I think this code is still a little wrong
Typesafe Config doesn’t really expect the extension
not sure how that affects it
it works in the Atomix tests but maybe it’s causing some problems
doesn’t seem to make a difference
Ronnie
@rroller
May 29 2018 20:49
weird. would you like my test?
Jordan Halterman
@kuujo
May 29 2018 20:51
I reproduced it so I’ll fix it
strange… seems to be loading the configuration correctly but not applying it
Jordan Halterman
@kuujo
May 29 2018 20:59
Ahh I know what’s going on
it’s the missing atomix-primary-backup dependency
the problem is defaults.conf also contains registration information for the primary-backup protocol, and if a user doesn’t add that protocol as a dependency then it’s not on the class path
the ConfigMapper tries to load the classes when the configuration is loaded
probably just need to split defaults.conf into several files and move the Raft/primary-backup registrations into those modules
and let Typesafe Config merge them
Add the atomix-primary-backup module and I bet it works
but you shouldn’t have to
I’ll fix it
Johno Crawford
@johnou
May 29 2018 21:13
Yeah I had to do that
Also related
atomix/atomix#576
Jordan Halterman
@kuujo
May 29 2018 21:28
easy fix
Ronnie
@rroller
May 29 2018 21:32
sweet. Thank you very much for being so responsive
Jordan Halterman
@kuujo
May 29 2018 21:33
will push the snapshot momentito
Ronnie
@rroller
May 29 2018 21:34
perfect. I'll confirm once pushed
Jordan Halterman
@kuujo
May 29 2018 22:35
I pushed it a bit ago.

Still cleaning up the configuration a bit. I’m actually going to split it into two parts:
registry.conf is for registering new types (primitive types, partition group/protocol types, profile types)
atomix.conf is for the instance configuration (cluster, primitives, partition groups, profiles)

This allows an AtomixConfig to also be constructed without impacting the registered types which can still be loaded from a configuration file.

Pretty close to working in ONOS now. Hopefully tonight
Ronnie
@rroller
May 29 2018 23:23
sorry back, testing now
fwiw, i don't use .conf files at all. I construct Atomix completely in code in java
just confirming that is not an issue
Ronnie
@rroller
May 29 2018 23:29
confirmed, fix worked. thanks!
Ronnie
@rroller
May 29 2018 23:46
hmm, maybe not. I'm still getting Caused by: io.atomix.utils.config.ConfigurationException: Unknown partition group type raft