Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Agreed, you need to do this via a "command". The concept of a node "checking if it's the leader" is racy, unless you put it through the Raft subsystem. You could end up with two nodes executing a job that you only wanted executed once.Check out this document, and an issue, related to racy leader checks in a raft-based system I built:-----------------------------------------
http://www.philipotoole.com
On Monday, January 15, 2018 10:30 PM, Oren Eini (Ayende Rahien) wrote:
How long is a job, what happens if after the check, there is new leader?Better to do this via a raft command.You have a set of nodes. Each minute they send a command "gimmie the job", the state machine select one of them for this minute.That is consistent and stable.--Hibernating Rhinos LtdOn Tue, Jan 16, 2018 at 2:39 AM, Ngm wrote:Hello,I need to execute certain jobs in regular intervals (say every min). If a single node does this, we have a single point of failure. To avoid this, I was thinking of following scheme:1. Nodes form a raft cluster, with leader election2. Only the leader executes scheduled jobs2.1. Every node checks if it is the leader before executing jobs.In order to achieve this only leader election is necessary. So is it possible that I only implement the leader election part of RAFT and achieve this? Are there are any problems with this approach?
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+unsubscribe@googlegroups.com.