-
Notifications
You must be signed in to change notification settings - Fork 39
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
Conversation
// 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 { |
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.
FYI, support for this is something we'll be focusing on after 1.0
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. 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. " + |
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.
This is probably valuable enough context to keep at Info
, but just a heads up this will log every time a cluster is processed.
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
Codecov Report
@@ 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.
|
// 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 { |
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.
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)
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.