Add ChangeTabletTags RPC to vtctl, ChangeTags RPC to vttablet#16857
Add ChangeTabletTags RPC to vtctl, ChangeTags RPC to vttablet#16857rohit-nayak-ps merged 7 commits intovitessio:mainfrom
ChangeTabletTags RPC to vtctl, ChangeTags RPC to vttablet#16857Conversation
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"} 1And 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
go/vt/topotools/tablet.go
Outdated
There was a problem hiding this comment.
I don't see this function being used anywhere other than test code. Is this right?
There was a problem hiding this comment.
@GuptaManan100 correct, which is a bit confusing - but I copied ChangeType quite literally
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
831ebd4 to
4d8f9ba
Compare
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
| [`--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.
We generally keep the summary short and expect users to look at the vitess.io docs for the details.
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
…vitessio#16857) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com>
* Add tablet-tags/`--init_tags` stats (vitessio#16695) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> * Add `ChangeTabletTags` RPC to `vtctl`, `ChangeTags` RPC to `vttablet` (vitessio#16857) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> --------- Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
Description
As discussed in #16377, this PR implements a new
vtctldand correspondingvttabletRPC to allow the tags of a tablet to be changedChangeTabletTagsChangeTagsThe 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