Usage of etcd/raft

87 views
Skip to first unread message

Nils Lagerkvist

unread,
May 2, 2015, 2:24:40 PM5/2/15
to etcd...@googlegroups.com
I'm trying to follow the documentation of in the raft library in etcd, and I was hoping that someone could review my code.

The example should:
* start a three node cluser
* wait for it to start
* commit one data entry to the cluster
* read the data entry back

If someone have time please check that the cluster node implementation looks sane. 

Also, I don't know how to check that the cluster is ready or that a proposed value has been written. 
In addition, is it safe to fetch the a stored value directly from the node? as there is no consensus. 


Thanks in advance!

Nils Lagerkvist

unread,
May 2, 2015, 2:27:04 PM5/2/15
to etcd...@googlegroups.com
Sorry, link to the gist was wrong, https://gist.github.com/otm/1877fdf922b8b6f8ce35

Brandon Philips

unread,
May 11, 2015, 6:20:45 PM5/11/15
to Nils Lagerkvist, etcd...@googlegroups.com
On Sat, May 2, 2015 at 11:24 AM, Nils Lagerkvist
<nils.la...@gmail.com> wrote:
> If someone have time please check that the cluster node implementation looks
> sane.

I quickly looked and it seems fine.

> Also, I don't know how to check that the cluster is ready or that a proposed
> value has been written.

In etcd we generate a random ID and wait for that ID to be applied.

https://github.com/coreos/etcd/blob/master/etcdserver/server.go#L492
https://github.com/coreos/etcd/blob/master/etcdserver/server.go#L716

Cheers,

Brandon

Nils Lagerkvist

unread,
May 13, 2015, 9:45:38 AM5/13/15
to etcd...@googlegroups.com, nils.la...@gmail.com
Thanks for looking at the code. 
Reply all
Reply to author
Forward
0 new messages