* 'Oren Eini (Ayende Rahien)' via raft-dev <
raft...@googlegroups.com> [21/04/16 22:54]:
> The reason you need to have the leader stay until deposed is
> that you are running the risk of the chosen successor failing.
> The way to handle that is to have the new candidate announce
> that this is a forced election, and sticky leadership should be
> ignored. That would make the rest of the system behave properly.
> The good thing about it is that sans failure, that is very
> predictable process, so anyone who is implementing leadership
> transfer has to implement this, otherwise, with sticky
> leadership, that won't work at all, as you noted.
Thanks Oren.
Just to clarify, this wasn't exactly my question. Obviously, if
forced election succeeds, the leader will step down.
I was exploring what happens if the forced election fails, and
whether or not aborting the transfer on a timeout is the best
option in this case.
I suggested an alternative: convert the leader to a follower right
after sending TimeoutNow. That would eliminate the need for abort.
Henrik, in his reply, objected that the goal here is to minimize
the window when the log is closed for new appends. I should add
that another goal is to not accidentally lose appended records
during a transfer. This is achievable if the leader first syncs up
with the quorum of replicas (not *one* replica), and only then
sends TimeoutNow.
Even if the transfer fails, the quorum will have the latest log,
so will preserve it through a normal election which will sure
follow after a timeout. So it seemed a simpler alternative.
Meanwhile I've somewhat found a reason for being able to abort a
transfer on timeout. We might want to be able to do it anyway,
e.g. if a follower we tried to transfer leadership to happens to
be slow to sync the log, we're better off choosing another one.
Thanks again,