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

Method storeConfChange

conn/node.go:202–213  ·  view source on GitHub ↗

nolint:gosec // random node id generator does not require cryptographic precision

(che chan error)

Source from the content-addressed store, hash-verified

200
201//nolint:gosec // random node id generator does not require cryptographic precision
202func (n *Node) storeConfChange(che chan error) uint64 {
203 n.Lock()
204 defer n.Unlock()
205 id := rand.Uint64()
206 _, has := n.confChanges[id]
207 for has {
208 id = rand.Uint64()
209 _, has = n.confChanges[id]
210 }
211 n.confChanges[id] = che
212 return id
213}
214
215// ConfState would return the latest ConfState stored in node.
216func (n *Node) ConfState() *raftpb.ConfState {

Callers 1

ProposeConfChangeMethod · 0.95

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected