-
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
Add ChangeTabletTags
RPC to vtctl
, ChangeTags
RPC to vttablet
#16857
Add ChangeTabletTags
RPC to vtctl
, ChangeTags
RPC to vttablet
#16857
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: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16857 +/- ##
==========================================
- Coverage 69.45% 69.41% -0.05%
==========================================
Files 1570 1570
Lines 203631 203798 +167
==========================================
+ Hits 141441 141474 +33
- Misses 62190 62324 +134 ☔ View full report in Codecov by Sentry. |
2334df5
to
c96c95a
Compare
I assume this change would need some website docs that I'm happy to add. Any suggestions "where" this should go is appreciated! |
d94aede
to
a80b960
Compare
a80b960
to
3c9a150
Compare
👋 I've tested this on our infrastructure and things are looking good so far (after fixing one issue): tvaillancourt@REDACTED:~$ vtctldclient $FLAGS GetTablet us_east_1b-0170348168 | jq .tags
{
"hello": "world"
}
tvaillancourt@REDACTED:~$ vtctldclient $FLAGS ChangeTabletTags us_east_1b-0170348168 test=123
- [hello: "world"]
+ [hello: "world" test: "123"]
tvaillancourt@REDACTED:~$ vtctldclient $FLAGS GetTablet us_east_1b-0170348168 | jq .tags
{
"hello": "world",
"test": "123"
} And tvaillancourt@REDACTED:~$ vtctldclient $FLAGS ChangeTabletTags --replace us_east_1b-0170348168 replace=true
- [hello: "world" test: "123"]
+ [replace: "true"]
tvaillancourt@REDACTED:~$ vtctldclient $FLAGS GetTablet us_east_1b-0170348168 | jq .tags
{
"replace": "true"
} And the stats: tvaillancourt@REDACTED:~$ curl -s localhost:15000/metrics | grep tablet_tags
# HELP vttablet_tablet_tags Tablet tags key/values
# TYPE vttablet_tablet_tags gauge
vttablet_tablet_tags{key="replace",value="true"} 1 And the I1002 06:06:49.280457 1915886 tm_state.go:243] Changing Tablet Tags: map[replace:true] for cell:"us_east_1b" uid:170348168 |
9a2759d
to
c7b30bc
Compare
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.
Rest LGTM!
// ChangeTags changes the tags of the tablet. Make this external, since these | ||
// transitions need to be forced from time to time. | ||
// | ||
// If successful, the updated tablet record is returned. | ||
func ChangeTags(ctx context.Context, ts *topo.Server, tabletAlias *topodatapb.TabletAlias, tabletTags map[string]string, replace bool) (*topodatapb.Tablet, error) { |
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.
I don't see this function being used anywhere other than test code. Is this right?
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.
@GuptaManan100 correct, which is a bit confusing - but I copied ChangeType
quite literally
Signed-off-by: Tim Vaillancourt <[email protected]>
831ebd4
to
4d8f9ba
Compare
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
changelog/21.0/21.0.0/summary.md
Outdated
@@ -218,3 +219,22 @@ work automatically during the [`MoveTables`](https://vitess.io/docs/reference/vr | |||
[`--remove-sharded-auto-increment` boolean flag](https://vitess.io/docs/20.0/reference/programs/vtctldclient/vtctldclient_movetables/vtctldclient_movetables_create/) and you should begin using the new | |||
[`--sharded-auto-increment-handling` flag](https://vitess.io/docs/21.0/reference/programs/vtctldclient/vtctldclient_movetables/vtctldclient_movetables_create/) instead. Please see the new | |||
[`MoveTables` Auto Increment Handling](https://vitess.io/docs/21.0/reference/vreplication/movetables/#auto-increment-handling) documentation for additional details. | |||
|
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.
We generally keep the summary short and expect users to look at the vitess.io docs for the details.
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.
@rohit-nayak-ps makes sense, updated!
Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Description
As discussed in #16377, this PR implements a new
vtctld
and correspondingvttablet
RPC to allow the tags of a tablet to be changedChangeTabletTags
ChangeTags
The new RPC supports both replacing and merging the existing tags. This merging happens on the tablet under a lock
CLI
Related Issue(s)
Resolves: #16873
Original discussion: #16377
Checklist
Deployment Notes