-
Notifications
You must be signed in to change notification settings - Fork 500
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
fix pd control bugs #245
fix pd control bugs #245
Conversation
@@ -316,7 +330,7 @@ func (pc *pdClient) DeleteStore(storeID uint64) error { | |||
defer DeferClose(res.Body, &err) | |||
|
|||
// Remove an offline store should returns http.StatusOK | |||
if res.StatusCode == http.StatusOK { | |||
if res.StatusCode == http.StatusOK || res.StatusCode == http.StatusNotFound { |
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.
Does DeleteStore
request's response will return http.StatusNotFound
?
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.
the response return 500 code too, this is no use now. It's just a standard way.
@@ -338,14 +366,28 @@ func (pc *pdClient) DeleteMemberByID(memberID uint64) error { | |||
return err | |||
} | |||
defer DeferClose(res.Body, &err) | |||
if res.StatusCode == http.StatusOK { | |||
if res.StatusCode == http.StatusOK || res.StatusCode == http.StatusNotFound { |
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.
ditto
/run-e2e-tests |
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.
LGTM
/run-e2e-tests |
LGTM. There is still a race condition between get and delete so we need to make sure our delete method is retried once. Fixing this upstream in PD itself will make things much smoother in the long-term. |
@gregwebs |
/run-e2e-tests |
@xiaojingchen yes, its possible between get and delete that it is deleted (by a different program than tidb-operator). |
@gregwebs but that error will only happen once, and the caller will try again without any problem. |
/run-e2e-tests |
/run-e2e-tests |
* add pd-recover doc * update for how to get max alloc id * query prometheus to get max alloc id * Apply suggestions from code review Co-authored-by: Lilian Lee <lilin@pingcap.com> * update format * zh: udpate format and optimize steps Co-authored-by: Lilian Lee <lilin@pingcap.com>
this PR fixes #238 #239
But this is a temporary solution, the fundamental solution is making PD API returns error code 404 when no found member.
@gregwebs @weekface @tennix PTAL