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

[query] api: Allow in-place topic consumer updates #2186

Merged
merged 6 commits into from
Mar 3, 2020

Conversation

schallert
Copy link
Collaborator

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 consumers
in-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?:


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
Copy link

codecov bot commented Mar 2, 2020

Codecov Report

Merging #2186 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2186   +/-   ##
======================================
  Coverage    72.2%   72.2%           
======================================
  Files        1017    1017           
  Lines       88268   88268           
======================================
  Hits        63770   63770           
  Misses      20214   20214           
  Partials     4284    4284           
Flag Coverage Δ
#aggregator 82.0% <0.0%> (ø) ⬆️
#cluster 85.2% <0.0%> (ø) ⬆️
#collector 82.8% <0.0%> (ø) ⬆️
#dbnode 79.0% <0.0%> (ø) ⬆️
#m3em 74.4% <0.0%> (ø) ⬆️
#m3ninx 74.2% <0.0%> (ø) ⬆️
#m3nsch 51.1% <0.0%> (ø) ⬆️
#metrics 17.6% <0.0%> (ø) ⬆️
#msg 74.8% <0.0%> (ø) ⬆️
#query 68.1% <0.0%> (ø) ⬆️
#x 83.2% <0.0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15a1085...e6f3f91. Read the comment docs.

Copy link
Collaborator

@arnikola arnikola left a 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.
Copy link
Collaborator

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).
Copy link
Collaborator

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.
Copy link
Collaborator

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 {
Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: 2020

Comment on lines +125 to +128
if err != nil {
logger.Error("unable to convert topic to protobuf", zap.Error(err))
xhttp.Error(w, err, http.StatusInternalServerError)
return
Copy link
Collaborator

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?

Copy link
Collaborator

@arnikola arnikola left a comment

Choose a reason for hiding this comment

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

lgtm

@schallert schallert merged commit 884004e into master Mar 3, 2020
@schallert schallert deleted the schallert/topic_remove_consumer branch March 3, 2020 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants