-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
vtadmin onlineddl endpoints #15114
vtadmin onlineddl endpoints #15114
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #15114 +/- ##
===========================================
+ Coverage 47.29% 70.61% +23.31%
===========================================
Files 1137 1377 +240
Lines 238684 182789 -55895
===========================================
+ Hits 112895 129075 +16180
+ Misses 117168 53714 -63454
+ Partials 8621 0 -8621 ☔ View full report in Codecov by Sentry. |
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.
Other than the 1 noted typo (I'm assuming), this looks good to me. I think you're planning to push more code though?
yeah i'll be pushing up unit tests today! then we should be good to go |
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
ea9ca60
to
6e40621
Compare
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
Signed-off-by: Andrew Mason <[email protected]>
bump on this, i'd like it to make it into #15136 |
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.
Hopefully my comments make sense. I was trying to review just the commits added since my previous review commit by commit.
) | ||
|
||
for _, c := range clusters { | ||
for _, r := range requestsByCluster[c.ID] { |
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.
IMO it's worth a safety check that requestsByCluster[c.ID]
is not nil — even though it should not be. But we don't want to crash vtadmin if something odd happens, right? Perhaps we're recovering elsewhere though.
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.
m sync.Mutex | ||
wg sync.WaitGroup |
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.
Any reason not to use an errgroup
? Seems like it would be a perfect fit -- making the code simpler to read and ending earlier.
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.
the main difference between errgroup
and this pattern is the following (emphasis mine):
Wait blocks until all function calls from the Go method have returned, then returns the first non-nil error (if any) from them.
we would be losing information by switching, as we currently collect all errors. and (as i understand it) errgroup
doesn't actually terminate other goroutines early if one returns an error, it just limits the amount of error information you get, so it doesn't end up ending earlier
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.
Yeah, it doesn't forcefully end anything AFAIUI — it cancels the context (assuming errgroup.WithContext() was used) so it should cause things to end earlier assuming that the errgroup's context is used by calls within the errgroup's Go function AND that the code executed in the goroutines check for context cancellation. Even so, the point about losing error information is valid. I was just curious -- the current code is fine.
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.
My only remaining valid comments/suggestions were minor, so will approve and you can address those as you feel is best.
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.
The interfaces look good to me, pending @mattlord 's comments!
Signed-off-by: Andrew Mason <[email protected]>
Description
This hooks up all the vtadmin API endpoints to make use of vtctld's schema migration management endpoints which were added in the previous version.
Quick demo for sanity:
Related Issue(s)
Closes #15113
Checklist
Deployment Notes