mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: skip bootstrap addNode entry
This is a hack to make etcd work normally.
This commit is contained in:
parent
6a62621695
commit
cdea98d434
@ -526,6 +526,14 @@ func (s *EtcdServer) applyConfChange(cc raftpb.ConfChange) {
|
||||
s.node.ApplyConfChange(cc)
|
||||
switch cc.Type {
|
||||
case raftpb.ConfChangeAddNode:
|
||||
// TODO(yichengq): this is the hack and should be removed SOON.
|
||||
// Bootstrap write addNode entries into log, which don't set Context
|
||||
// value. They don't need to be applied because now we do it explicitly
|
||||
// before server starts. This hack makes etcd work, and will be removed
|
||||
// in the following PR.
|
||||
if cc.Context == nil {
|
||||
break
|
||||
}
|
||||
var m Member
|
||||
if err := json.Unmarshal(cc.Context, &m); err != nil {
|
||||
panic("unexpected unmarshal error")
|
||||
|
Loading…
x
Reference in New Issue
Block a user