(e raftpb.Entry)
| 289 | } |
| 290 | |
| 291 | func (n *node) applyConfChange(e raftpb.Entry) { |
| 292 | var cc raftpb.ConfChange |
| 293 | if err := cc.Unmarshal(e.Data); err != nil { |
| 294 | glog.Errorf("While unmarshalling confchange: %+v", err) |
| 295 | } |
| 296 | |
| 297 | if cc.Type == raftpb.ConfChangeRemoveNode { |
| 298 | n.DeletePeer(cc.NodeID) |
| 299 | } else if len(cc.Context) > 0 { |
| 300 | var rc pb.RaftContext |
| 301 | x.Check(proto.Unmarshal(cc.Context, &rc)) |
| 302 | n.Connect(rc.Id, rc.Addr) |
| 303 | } |
| 304 | |
| 305 | cs := n.Raft().ApplyConfChange(cc) |
| 306 | n.SetConfState(cs) |
| 307 | n.DoneConfChange(cc.ID, nil) |
| 308 | } |
| 309 | |
| 310 | var errHasPendingTxns = errors.New("Pending transactions found. Please retry operation") |
| 311 |
no test coverage detected