1

I am going through this lecture series by Martin Kleppman. In this video at around 1:25, he says you can manually configure the distributed nodes to chose a leader.

If that's the case can't we just automate the process by having a different process running that just checks for the health of the leader and chooses a new leader after the leader's failure or network partition.

Why is this problem actually so hard? Why can't we solve the consensus problem by enforcing a new leader without the nodes having to actually come to an agreement What am I missing?

user3666197
  • 1
  • 6
  • 50
  • 92
matrixisreal
  • 289
  • 4
  • 11
  • 1
    For a second there I was going to mark as off topic because it’s about politics. However, I do think this is best suited for the computer science stack exchange and not stack overflow. https://cs.stackexchange.com/ – Fogmeister Jan 21 '22 at 07:46
  • I’m voting to close this question because it belongs on https://cs.stackexchange.com/ – Fogmeister Jan 21 '22 at 07:47
  • Haha. Okay I'll move it stackexchange – matrixisreal Jan 21 '22 at 10:32

1 Answers1

2

Let's say we have an active leader and a passive one. The passive one listens for active's heartbeat. When the heartbeat is not heard, the passive one switches to active mode and, maybe, tell everyone - "I am the leader...".

The problem is that just because the passive one hears no heartbeat, it does not mean that the true leader is off - maybe there is a network issue in between these two boxes?

Another option - the leader may get offline for a short period of time - enough for the passive one to detect; but later, the original leader comes back online - now there are two leaders.

The general problem to resolve here is how to build a failure detector. It is tricky. In the last example, the old leader comes back, thinks it is the leader; but that is not true.

AndrewR
  • 1,252
  • 8
  • 7
  • +1 & another, by no means less important, is a distributed-system self-protection against spurious storms of consensus-seeking. adding some type of cost for leader to take place in spawning a new wave of consensus seeking is one such direction. Ms. Margaret HAMILTON's care, taken on blocking-prevention / timed conflict-resolution has saved Appolo 11 Moon landing - a lot to learn from ... *Anyway - **Stay well & stay tuned** & actively contributing to this great Community of Knowledge* – user3666197 Mar 03 '22 at 12:32