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

Method isMember

worker/draft.go:1912–1927  ·  view source on GitHub ↗

Checks if its a peer from the leader of the group.

()

Source from the content-addressed store, hash-verified

1910
1911// Checks if its a peer from the leader of the group.
1912func (n *node) isMember() (bool, error) {
1913 pl, err := n.leaderBlocking()
1914 if err != nil {
1915 return false, err
1916 }
1917
1918 gconn := pl.Get()
1919 c := pb.NewRaftClient(gconn)
1920 glog.Infof("Calling IsPeer")
1921 pr, err := c.IsPeer(n.ctx, n.RaftContext)
1922 if err != nil {
1923 return false, errors.Wrapf(err, "error while joining cluster")
1924 }
1925 glog.Infof("Done with IsPeer call\n")
1926 return pr.Status, nil
1927}
1928
1929func (n *node) retryUntilSuccess(fn func() error, pause time.Duration) {
1930 var err error

Callers 1

InitAndStartNodeMethod · 0.95

Calls 5

leaderBlockingMethod · 0.95
IsPeerMethod · 0.95
NewRaftClientFunction · 0.92
InfofMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected