Skip to content
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

Merged
merged 9 commits into from
Sep 3, 2019
Merged

adding the draining mode #3880

merged 9 commits into from
Sep 3, 2019

Conversation

gitlw
Copy link

@gitlw gitlw commented Aug 28, 2019

This change is Reviewable

@gitlw gitlw requested review from manishrjain and a team as code owners August 28, 2019 21:05
Copy link

@pullrequest pullrequest bot left a 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.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 Message
The description of this pull request is blank. Adding a high-level summary will help our reviewers provide better feedback.

@gitlw gitlw mentioned this pull request Aug 28, 2019
Copy link

@pullrequest pullrequest bot left a 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

dgraph/cmd/alpha/http_test.go Outdated Show resolved Hide resolved
dgraph/cmd/alpha/admin.go Show resolved Hide resolved
Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: 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.

Copy link
Author

@gitlw gitlw left a 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.

@gitlw gitlw merged commit 97a4eb3 into master Sep 3, 2019
@gitlw gitlw deleted the gitlw/adding_draining_mode2 branch September 3, 2019 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants