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 calls to /namespace/ready if supported by coordinator #245

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Conversation

nbroyles
Copy link
Collaborator

Add support for transitioning namespaces to a ready state after they've been created. This operates as a signal to coordinators pulling namespace information from etcd that the namespace is ready for use.

// NB(nate): Marking namespaces ready (without force) involves checking dbnodes for namespace
// availability. External coordinators do not have connections to dbnodes so don't attempt this
// step for now.
if cluster.Spec.ExternalCoordinator != nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI, support for this is something we'll be focusing on after 1.0

Copy link
Collaborator

@schallert schallert left a comment

Choose a reason for hiding this comment

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

LGTM. Let's just make sure we test this in a few different configurations (e.g. external coordinator).

}
err := c.adminClient.namespaceClientForCluster(cluster).Ready(req)
if pkgerrors.Cause(err) == m3admin.ErrNotFound {
c.logger.Info("coordinator does not yet support the ready endpoint. " +
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is probably valuable enough context to keep at Info, but just a heads up this will log every time a cluster is processed.

Copy link
Collaborator

@jeromefroe jeromefroe left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Oct 27, 2020

Codecov Report

Merging #245 into master will increase coverage by 0.00%.
The diff coverage is 78.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #245   +/-   ##
=======================================
  Coverage   76.29%   76.29%           
=======================================
  Files          30       30           
  Lines        2168     2215   +47     
=======================================
+ Hits         1654     1690   +36     
- Misses        380      388    +8     
- Partials      134      137    +3     

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 f396e2b...cae9a63. Read the comment docs.

// NB(nate): Due to bug in coordinator API routing logic, missing routes may
// also be returned as 405s (i.e. method not allowed). So check for that in addition
// to 404s.
if cause == m3admin.ErrNotFound || cause == m3admin.ErrMethodNotAllowed {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was a fun little discovery during testing. Depending on the route, misses will either return a 404 or a 405. Almost certainly a bug in our routing logic, but since these coordinators will be out there in the wild, we need to account for it.

(cc @schallert since this is a small update after the LGTM)

@nbroyles nbroyles merged commit d8151fd into master Oct 28, 2020
@nbroyles nbroyles deleted the nb/ready branch October 28, 2020 16:33
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.

3 participants