-
Notifications
You must be signed in to change notification settings - Fork 728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: add api member delete #245
Conversation
resp, err := s.hc.Get(strings.Join(parts, "")) | ||
c.Assert(err, IsNil) | ||
buf, err := ioutil.ReadAll(resp.Body) | ||
c.Assert(err, IsNil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close resp.Body?
In etcd, if we removed a member with ID, we can't add this member with same ID again. |
cfgs, _, clean := mustNewCluster(c, 3) | ||
defer clean() | ||
|
||
someone := rand.Intn(len(cfgs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/someone/target/
Cluster: pd1, pd2, pd3 If pd2 was removed, a new pd named |
if has data, can join? |
|
||
for _, t := range table { | ||
parts := []string{"http://", t.addr, "/api/v1/members", "/" + t.name} | ||
req, err := http.NewRequest(http.MethodDelete, strings.Join(parts, ""), nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't compile in go 1.5 with http.MethodDelete, see travis CI.
Unfortunately, we can's use Howerver, |
so we should check data dir when join and must ensure the joining peer is clear and new. |
Yes, I guess, but it's another story, maybe I should tweak join flag in another PR, let's focus on delete api 😄 |
yes, I will open another issue for you. |
|
||
// step 1. get etcd id | ||
var id uint64 | ||
name := (mux.Vars(r))["name"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check empty or missing name here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it is fine, only DELETE /api/v1/members/xxx
will be routed to here.
LGTM |
@huachaohuang PTAL |
LGTM |
#235
PTAL @siddontang @huachaohuang @qiuyesuifeng