Re: [jgroups-dev] RAFT consensus protocol

Bela Ban <[email protected]> Mon, 27 Oct 2014 12:55:38 +0100
Newsgroups gmane.comp.java.javagroups.devel
Message-ID <[email protected]>
Hi Ugo,

On 26/10/14 19:24, ugol wrote:
> Hi all,
> I am a JGroups dev newbie, and decided to try to implement RAFT [1]
> consensus protocol on top of JGroups. RAFT is at the core of etcd and is
> gaining momentum, I think a JGroups implementation could be useful
> either for JGroups and for people needing a pure Java implementation.
>
> I was skimming the documentation and JGroups code and have some
> questions, hope to start with the right foot:
>
> - first, is there an "hello world" Jgroups protocol to start with? Is it
> the EXAMPLE protocol?

Yes. Let me outline a few thoughts on how this could be done (I skimmed 
over the RAFT docs).

- A new RAFT protocol layered somewhere the top of the stack. This way, 
you could use lower level protocols such as COMPRESS, ENCRYPT, 
retransmission etc
   - The heartbeat used to check for liveness and message dissemination 
could be done via a timer task in RAFT (see NAKACK2 as an example of how 
this is done)

- A RAFT$Header class which is used to carry information about requests 
/ responses

- A building block which (a) accepts requests from clients (e.g. via a 
TCP socket) and (b) events which are used to 'talk' between the building 
block and the RAFT protocol (look at CENTRAL_LOCK as an example)
   - The building block would also store values, e.g. behave like a 
simple key/value store



> - it's not clear to me if I have to code "inside" JGroups (i.e. create
> things like RAFT_LEADER_ELECTION, RAFT_SUSPECT and similar protocols) or
> I can code everything "outside", i.e. using the MessageDispatcher class
> - supposing the former, if I want to base everything on TCP do I need to
> start extending BasicTCP?
>
> I have many more questions but that should be enough to start :)
>
> [1] I am sure everyone already knows it, but here is the link if needed
> http://raftconsensus.github.io
>
> --
> uL


-- 
Bela Ban, JGroups lead (http://www.jgroups.org)

------------------------------------------------------------------------------
_______________________________________________
Javagroups-development mailing list