Checks if its a peer from the leader of the group.
()
| 1910 | |
| 1911 | // Checks if its a peer from the leader of the group. |
| 1912 | func (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 | |
| 1929 | func (n *node) retryUntilSuccess(fn func() error, pause time.Duration) { |
| 1930 | var err error |
no test coverage detected