etcd/raft - what happens when a follower creates a proposal?

388 views
Skip to first unread message

susanggg...@gmail.com

unread,
May 2, 2017, 12:00:32 PM5/2/17
to etcd-dev
I'm referring to this code in node.Propose() and also node.ProposeConfChange(). If a follower executes this command will it fail or will it be forwarded to the leader? In my experiments, it seems both configuration proposals and application proposals will be forwarded to the leader, so in other words it is safe to send these requests to any node in the cluster, rather than having to track the dynamic leader at the application level - can someone confirm?

Thank you,

S

susanggg...@gmail.com

unread,
May 2, 2017, 12:03:58 PM5/2/17
to etcd-dev
(And to clarify, my experiments are using the raftexample setup.)

Gyu-Ho Lee

unread,
May 2, 2017, 12:05:44 PM5/2/17
to susanggg...@gmail.com, etcd-dev
> it is safe to send these requests to any node in the cluster

Package raft will forward all proposals to leader.

So you don't have to track manually, which node is the leader.


--
You received this message because you are subscribed to the Google Groups "etcd-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etcd-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Sincerely,
Gyu-Ho Lee

Susan Ackerman

unread,
May 2, 2017, 12:10:57 PM5/2/17
to Gyu-Ho Lee, etcd-dev
Thank you! Very clear code, BTW.

One other question: is there any possibility for routing loops in pathological situations (e.g. due to leader flipping)? If the node that receives the forwarded message is no longer the leader, what would happen? Would it forward it on to who it thinks is the leader?

S

Gyu-Ho Lee

unread,
May 2, 2017, 12:21:35 PM5/2/17
to Susan Ackerman, etcd-dev
Yes, a message to old leader (now follower) will go to the new leader.
Or the message could arrive at the old leader just before its stepping
down and get appended. But this entry will later be overwritten by the
--
Sincerely,
Gyu-Ho Lee
Reply all
Reply to author
Forward
0 new messages