These are chat archives for atomix/atomix

Mar 2017
Jordan Halterman
Mar 25 2017 00:21

@hntd187 Sorry I've been busy...

  1. Why would you want to do that? I'd say just create a new client. But keep in mind that the client keeps track of server addresses itself. In other words, you give it an initial server or servers to connect to, and it immediately gets a full view of the cluster. So adding/removing nodes will also update clients.

If you want to replace the cluster, you might be able to trick the client by implementing a ServerSelectionStrategy and returning a different set of addresses. That's obviously a hack. It would be better to just close/reconnect (not so sure that works) or create a new client.

  1. Yes, the metastore uses an in-memory buffer, and you're exactly right! We really only use MEMORY for testing state machines and what not right now. Losing the term is very problematic for more reasons than just the one you mentioned. But concerns about the leader election process are the least of your worries if you're using an in-memory log. The real problem is, if a majority of servers go down then basically any server can win an election when a quorum is restored, meaning the cluster may just delete all your state.
  2. Yes. Heap memory is just used right now for stability. I haven't really tested off heap memory since it's just used for testing.

  3. That's correct. The client could expire its own session, but there's not really a good reason to do that. Even if the entire cluster goes down, once the client's able to start communicating with it again, its session may still be active. The cluster can't expire a session if a majority is down. There's no reason to lose consistency guarantees proactively if it may not be necessary.

As for your last question, you can partition it. We use a partitioned Atomix cluster in ONOS with a bunch of custom resources that do partitioning. But for leader election there's not really a need for it. We do leader election in a single primary shard and partition things like maps for scalability.
Jordan Halterman
Mar 25 2017 00:27
Copycat supports sequential reads from followers like a ZooKeeper does (using ConsistencyLevel.SEQUENTIAL)
The partitioning that's done in ONOS is likely to make its way back into Atomix some time this year
...or at least somewhere that's not ONOS anyways
Jordan Halterman
Mar 25 2017 08:53
It makes sense to require a log directory so the metadata can at least be stored on disk, though. Your particular use case can be suited by an in-memory log, so I think it's reasonable to make that change now. I can do it in the next few days.