dragonboat icon indicating copy to clipboard operation
dragonboat copied to clipboard

Get notified about clusters a node is part of, but has not joined

Open intrntbrn opened this issue 3 years ago • 2 comments

I was wondering if there is way to get notified about clusters a node is part of, but has not joined yet.

Let's say a node N is a voting member in a cluster where node L is the leader.

N crashes, restarts the process and initializes nodehost. L is now able detect that N recovered and is online again (via ConnectionEstablished event), but how is L able to determine if N actually joined the cluster (called startCluster) and makes progress?

Also, after restarting when N receives the first heartbeat of L, there is no ConnectionEstablished event for N. Is there another way to retrieve clusterID and nodeID to rejoin the cluster in that scenario?

intrntbrn avatar Jul 02 '21 13:07 intrntbrn

how is L able to determine if N actually joined the cluster (called startCluster) and makes progress?

For the raft implementation itself, it is determined once a message from N is received by L.

For your application built on top of the raft implementation, there is currently no available method to figure out whether N has been started or not. Is there any particular reason you want to know that N has been started?

lni avatar Jul 02 '21 15:07 lni

In my application the leader of a cluster has to report the state of the cluster (e.g. online status of peers) to a coordination/scheduling process (also raft backed). But since the ConnectionEstablished event only means that nodehost is initialized, it is pretty useless in that case. The peers might also share another cluster in the same configuration, so there wouldn't be a (new) event in the first place. This means that i have to implement another mechanism to provide such informations accurately, which adds complexity and RTT.

I feel like such basic data should be provided by the raft implementation itself. Or somehow being able to access heartbeat messages would make things a little bit easier.

intrntbrn avatar Jul 07 '21 13:07 intrntbrn