-
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
vtctldclient: Apply tablet type filtering for keyspace+shard in GetTablets #14467
Conversation
Signed-off-by: Matt Lord <[email protected]>
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
|
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
…blets (#14467) Signed-off-by: Matt Lord <[email protected]>
…+shard in GetTablets (#14467) (#14470) Signed-off-by: Matt Lord <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <[email protected]>
@@ -2016,6 +2018,9 @@ func (s *VtctldServer) GetTablets(ctx context.Context, req *vtctldatapb.GetTable | |||
|
|||
tablets := make([]*topodatapb.Tablet, 0, len(tabletMap)) | |||
for _, ti := range tabletMap { | |||
if req.TabletType != 0 && ti.Type != req.TabletType { |
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.
why is this 0
and not UNKNOWN
?
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.
Only because I copied the existing check/filter that was already used elsewhere in the function.🙂 I wish that I had changed both locations instead though. Whomever changes this file next should do that.
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.
Since it's a non-functional change I snuck it in here:
459a27b
Description
You can filter tablets by keyspace, shard, and tablet-type with the
GetTablets
command.There is a different path taken when keyspace and shard are both specified, however, and in that path the tablet type filtering was not done. This PR corrects that and applies the tablet type filtering everywhere if requested.
Related Issue(s)
Checklist