Closed Hoverbear closed 9 years ago
Another way to do this is to internally forward the request to the leader, however this makes a more brittle connection. Returning an error; ERR_REDIRECT
or something, with a host/port seems better to me.
@Manishearth Currently I'm looking to transparently forward a request from a Follower
to it's Leader
, what do you mean by 'brittle'?
If the follower goes down, it will break :)
@Manishearth If the follower goes down then the node won't be making requests anyways. :)
@Hoverbear Not if the follower tells the node the IP of the leader beforehand :)
@Manishearth Right, but if the follower goes down the consuming application on that node will have crashed too, yes?
What do you mean by a node here?
@Manishearth The library/application pair. Hmm.. I need to think about this.
We talked about this on IRC today for a bit and come up with these thoughts:
<hoverbear> So we agree that raft should act as an event emitter to the client (Our state machine)?
<dcb> yes
<hoverbear> And we're undetermined on if client requests should go over network, but yes we think that might be the right idea since that's how the raft paper describes it?
<dcb> yep, I'm quite sure it has to touch the network in at least some cases, if not most
<hoverbear> dcb: Yes, I think so too. So it might be best for the leader to just express interest in a second socket through mio or something. We can discuss this more.
It was determined that we'd do something along the lines of
consuming application <-> Raft <-> RaftNode <-> {State & StateMachine}
I'm currently struggling with how to properly handle the requests the "client" application makes to the library. Code here
How does a Follower of Raft handle this request? The Raft paper suggest a redirect, but I think this could be handled better.