-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
adding the draining mode #3880
adding the draining mode #3880
Conversation
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.
✅ A review job has been created and sent to the PullRequest network.
@gitlw you can click here to see the review status or cancel the code review job.
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.
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.
Looks good, sufficient amount of test cases. Curious on allowing either form data or json data for the POST/PUT payload. Although may not be a big deal if this isn't a commonly used API.
Reviewed with ❤️ by PullRequest
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.
Giving LGTM. But, there are serious comments. So, please address them carefully before merging.
Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @gitlw)
dgraph/cmd/alpha/admin.go, line 57 at r1 (raw file):
if err != nil { x.SetStatus(w, x.ErrorInvalidRequest, "Found invalid value for the enable parameter")
return?
dgraph/cmd/alpha/admin.go, line 61 at r1 (raw file):
x.UpdateDrainingMode(enable) x.Check2(w.Write([]byte(fmt.Sprintf(`{"code": "Success",`+
Please don't check fail on being able to write to w. The client might have crashed ITMT, after calling this request, in which case write would fail, causing the server to also crash.
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.
Reviewable status: 4 of 6 files reviewed, 4 unresolved discussions (waiting on @manishrjain and @pullrequest[bot])
dgraph/cmd/alpha/admin.go, line 52 at r1 (raw file):
Previously, pullrequest[bot] wrote…
Should this also allow form data for post/put or only query string parameters?
For now, only allowing query string parameter is ok.
dgraph/cmd/alpha/admin.go, line 57 at r1 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
return?
Done.
dgraph/cmd/alpha/admin.go, line 61 at r1 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
Please don't check fail on being able to write to w. The client might have crashed ITMT, after calling this request, in which case write would fail, causing the server to also crash.
Done.
dgraph/cmd/alpha/http_test.go, line 689 at r1 (raw file):
Previously, pullrequest[bot] wrote…
Extra line seems unecessary
Done.
This change is