MCPcopy
hub / github.com/dgraph-io/dgraph / ProposePeerRemoval

Method ProposePeerRemoval

conn/node.go:614–630  ·  view source on GitHub ↗

ProposePeerRemoval proposes a new configuration with the peer with the given id removed.

(ctx context.Context, id uint64)

Source from the content-addressed store, hash-verified

612
613// ProposePeerRemoval proposes a new configuration with the peer with the given id removed.
614func (n *Node) ProposePeerRemoval(ctx context.Context, id uint64) error {
615 if n.Raft() == nil {
616 return ErrNoNode
617 }
618 if _, ok := n.Peer(id); !ok && id != n.RaftContext.Id {
619 return errors.Errorf("Node %#x not part of group", id)
620 }
621 cc := raftpb.ConfChange{
622 Type: raftpb.ConfChangeRemoveNode,
623 NodeID: id,
624 }
625 err := errInternalRetry
626 for err == errInternalRetry {
627 err = n.ProposeConfChange(ctx, cc)
628 }
629 return err
630}
631
632type linReadReq struct {
633 // A one-shot chan which we send a raft index upon.

Callers 2

RemoveNodeMethod · 0.80
applyStateMethod · 0.80

Calls 4

RaftMethod · 0.95
PeerMethod · 0.95
ProposeConfChangeMethod · 0.95
ErrorfMethod · 0.45

Tested by

no test coverage detected