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

Add endpoint to set database bootstrappers dynamically #1239

Merged
merged 6 commits into from
Dec 11, 2018

Conversation

robskillington
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Dec 11, 2018

Codecov Report

Merging #1239 into master will decrease coverage by <.1%.
The diff coverage is 58.6%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1239     +/-   ##
========================================
- Coverage    70.7%   70.7%   -0.1%     
========================================
  Files         748     750      +2     
  Lines       63078   63136     +58     
========================================
+ Hits        44644   44672     +28     
- Misses      15553   15573     +20     
- Partials     2881    2891     +10
Flag Coverage Δ
#aggregator 81.6% <ø> (ø) ⬆️
#cluster 85.6% <ø> (-0.1%) ⬇️
#collector 78.4% <ø> (ø) ⬆️
#dbnode 80.8% <ø> (-0.1%) ⬇️
#m3em 73.2% <ø> (ø) ⬆️
#m3ninx 75.2% <ø> (ø) ⬆️
#m3nsch 51.1% <ø> (ø) ⬆️
#metrics 18.2% <ø> (ø) ⬆️
#msg 74.9% <ø> (ø) ⬆️
#query 60.3% <58.6%> (-0.1%) ⬇️
#x 76% <ø> (ø) ⬆️

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 4dc0ef1...268d158. Read the comment docs.

Copy link
Contributor

@richardartoul richardartoul left a comment

Choose a reason for hiding this comment

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

LGTM

return
}

array := new(commonpb.StringArrayProto)
Copy link
Contributor

Choose a reason for hiding this comment

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

you tested this right? It will allocate the underlying slice properly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, this works. Unmarshal handles that.

value, err := store.Get(kvconfig.BootstrapperKey)
if err != nil {
logger.Error("unable to get kv key", zap.Any("error", err))
xhttp.Error(w, err, http.StatusInternalServerError)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a 500? Seems like its basically the equivalent of a 404 or even a 200 with a null response or something

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll check if its ErrNotFound.

return nil, xhttp.NewParseError(fmt.Errorf("no values"), http.StatusBadRequest)
}

if err := dbconfig.ValidateBootstrappersOrder(array.Values); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, monorepo ftw

tags:
- "M3DB Database"
- "M3DB"
summary: "Configure M3DB set bootstrappers dynamically, which override config"
Copy link
Contributor

Choose a reason for hiding this comment

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

"Dynamically override the bootstrappers configured in M3DBs node-level configuration"

tags:
- "M3DB Database"
- "M3DB"
summary: "Configure M3DB get bootstrappers dynamically, which override config"
Copy link
Contributor

Choose a reason for hiding this comment

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

"Retrieve the dynamically configured bootstrappers override, if any."

@robskillington robskillington merged commit 26a60c6 into master Dec 11, 2018
@robskillington robskillington deleted the r/add-kv-bootstrappers-endpoint branch December 11, 2018 17:45
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