-
Notifications
You must be signed in to change notification settings - Fork 455
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
[query] api: Allow in-place topic consumer updates #2186
Conversation
Right now there are no HTTP APIs for updating a topic's consumers in-place. The only way to do so would be deleting + recreating the topic. This adds support for `PUT`-ing a topic to update its consumers in-place. Updating number of shards is currently not supported.
Codecov Report
@@ Coverage Diff @@
## master #2186 +/- ##
======================================
Coverage 72.2% 72.2%
======================================
Files 1017 1017
Lines 88268 88268
======================================
Hits 63770 63770
Misses 20214 20214
Partials 4284 4284
Continue to review full report at Codecov.
|
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, few nits
@@ -0,0 +1,136 @@ | |||
// Copyright (c) 2019 Uber Technologies, Inc. |
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.
nit: 2020
) | ||
|
||
const ( | ||
// UpdateURL is the url for the topic delete handler (with the PUT method). |
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.
nit: topic update handler
UpdateHTTPMethod = http.MethodPut | ||
) | ||
|
||
// UpdateHandler is the handler for topic adds. |
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.
nit: topic updates.
Also, probably don't need to export UpdateHandler?
client clusterclient.Client, | ||
cfg config.Configuration, | ||
instrumentOpts instrument.Options, | ||
) *UpdateHandler { |
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.
nit: probably should return an Http.Handler
rather than explicitly a *UpdateHandler
?
@@ -0,0 +1,155 @@ | |||
// Copyright (c) 2018 Uber Technologies, Inc. |
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.
nit: 2020
if err != nil { | ||
logger.Error("unable to convert topic to protobuf", zap.Error(err)) | ||
xhttp.Error(w, err, http.StatusInternalServerError) | ||
return |
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.
Is this fine to error here if the update has already happened?
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
What this PR does / why we need it:
Right now there are no HTTP APIs for updating a topic's consumers
in-place. The only way to do so would be deleting + recreating the
topic.
This adds support for
PUT
-ing a topic to update its consumersin-place. Updating number of shards is currently not supported.
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: