Skip to content

Commit

Permalink
Merge pull request #11665 from jingyih/automated-cherry-pick-of-#1163…
Browse files Browse the repository at this point in the history
…8-upstream-release-3.3

Automated cherry pick of #11638 on release-3.3
  • Loading branch information
spzala authored Mar 11, 2020
2 parents e21e355 + c58133b commit eb1df6d
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions etcdctl/ctlv3/command/member_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,30 +118,8 @@ func memberAddCommandFunc(cmd *cobra.Command, args []string) {
display.MemberAdd(*resp)

if _, ok := (display).(*simplePrinter); ok {
ctx, cancel = commandCtx(cmd)
listResp, err := cli.MemberList(ctx)
// make sure the member who served member list request has the latest member list.
syncedMemberSet := make(map[uint64]struct{})
syncedMemberSet[resp.Header.MemberId] = struct{}{} // the member who served member add is guaranteed to have the latest member list.
for {
if err != nil {
ExitWithError(ExitError, err)
}
if _, ok := syncedMemberSet[listResp.Header.MemberId]; ok {
break
}
// quorum get to sync cluster list
gresp, gerr := cli.Get(ctx, "_")
if gerr != nil {
ExitWithError(ExitError, err)
}
syncedMemberSet[gresp.Header.MemberId] = struct{}{}
listResp, err = cli.MemberList(ctx)
}
cancel()

conf := []string{}
for _, memb := range listResp.Members {
for _, memb := range resp.Members {
for _, u := range memb.PeerURLs {
n := memb.Name
if memb.ID == newID {
Expand Down

0 comments on commit eb1df6d

Please sign in to comment.