etcd : how does etcd handle 'write to follower'?

184 views
Skip to first unread message

Gyu-Ho Lee

unread,
Jun 23, 2015, 1:53:57 PM6/23/15
to coreo...@googlegroups.com
Hello, I am new to raft and etcd. 


Diego Ongaro explains that it's fine for a client to send requests to followers
, given that the client does not know which machine is the leader.
And just returns telling back the client which is the leader.

I deployed a cluster of 3 etcd machines
, assuming that all RPC could be done with simple cURL commands.
And the client is not expected to know which machine is the leader.

For this case, would it be ok to POST request to any of those 3 machines?
Or do I have to tell them to use etcd-client, where you can specify the 3 machines endpoints.

If it's ok to post requests to any machine, even if it might not be the leader,
how does etcd handle this and point this request to leader node?
Or do I misunderstand the raft algorithm?

Could anybody help me find the related code in etcd repo?

Thanks!

Brandon Philips

unread,
Jun 23, 2015, 3:00:17 PM6/23/15
to Gyu-Ho Lee, coreo...@googlegroups.com
Hello Gyu-Ho-

Yes, a client can submit a write request to any machine in the cluster. What happens is the etcd machine you contact creates a raft RPC and tags it with a unique id. When the machine sees that unique id tag come back as a raft log commit then it returns a 200 OK to the client.

Does that make sense? If you have more technical questions about etcd I would suggest you email etcd-dev instead. https://groups.google.com/forum/#!forum/etcd-dev

Thank You,

Brandon

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

Gyu-Ho Lee

unread,
Jun 23, 2015, 3:02:49 PM6/23/15
to Brandon Philips, coreo...@googlegroups.com
I see. That makes sense. Thanks for clarification. And I will go to the etcd mailing list next time. Thanks!

Sincerely,
Gyu-Ho Lee
Reply all
Reply to author
Forward
0 new messages