how etcd raft persist raft topology and membership change

104 views
Skip to first unread message

Jia

unread,
Jun 1, 2017, 2:37:48 PM6/1/17
to etcd-dev
Hello,

I am trying to understand how membership change works in etcd-raft and have some questions here. 

Correct me if I am wrong, it seems etcd-raft does not explicitly persist the raft topology, but instead treat each membership change as a raft log entry. I am looking at the node implementation of etcd-raft. Apparently, when starting a new node, it manually injects a configChangeEntry; and when restarting a node, it relies on replaying WAL logs from the very beginning to obtain peer information. 

However, what happens if we have a persisted appliedIndex, in which case raft won't re-apply all the logs from index 1? How does it know its peer information in order to join the group?

Thanks a lot. 

Jia

anthony...@coreos.com

unread,
Jun 1, 2017, 4:35:02 PM6/1/17
to etcd-dev
Cluster membership information is stored to etcd's storage backend. The persisting is done in https://github.com/coreos/etcd/tree/master/etcdserver/membership (in particular, store.go)

Jia

unread,
Jun 1, 2017, 5:23:54 PM6/1/17
to etcd-dev
Thanks! Good to know. The raftExample does not handle that, so we'll need to persist the configState accordingly. 
Reply all
Reply to author
Forward
0 new messages