Skip to content

Commit eb1df6d

Browse files
authored
Merge pull request #11665 from jingyih/automated-cherry-pick-of-#11638-upstream-release-3.3
Automated cherry pick of #11638 on release-3.3
2 parents e21e355 + c58133b commit eb1df6d

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

etcdctl/ctlv3/command/member_command.go

+1-23
Original file line numberDiff line numberDiff line change
@@ -118,30 +118,8 @@ func memberAddCommandFunc(cmd *cobra.Command, args []string) {
118118
display.MemberAdd(*resp)
119119

120120
if _, ok := (display).(*simplePrinter); ok {
121-
ctx, cancel = commandCtx(cmd)
122-
listResp, err := cli.MemberList(ctx)
123-
// make sure the member who served member list request has the latest member list.
124-
syncedMemberSet := make(map[uint64]struct{})
125-
syncedMemberSet[resp.Header.MemberId] = struct{}{} // the member who served member add is guaranteed to have the latest member list.
126-
for {
127-
if err != nil {
128-
ExitWithError(ExitError, err)
129-
}
130-
if _, ok := syncedMemberSet[listResp.Header.MemberId]; ok {
131-
break
132-
}
133-
// quorum get to sync cluster list
134-
gresp, gerr := cli.Get(ctx, "_")
135-
if gerr != nil {
136-
ExitWithError(ExitError, err)
137-
}
138-
syncedMemberSet[gresp.Header.MemberId] = struct{}{}
139-
listResp, err = cli.MemberList(ctx)
140-
}
141-
cancel()
142-
143121
conf := []string{}
144-
for _, memb := range listResp.Members {
122+
for _, memb := range resp.Members {
145123
for _, u := range memb.PeerURLs {
146124
n := memb.Name
147125
if memb.ID == newID {

0 commit comments

Comments
 (0)