vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.47k stars 2.09k forks source link

Add `ChangeTabletTags` RPC to `vtctl`, `ChangeTags` RPC to `vttablet` #16857

Open timvaillancourt opened 1 day ago

timvaillancourt commented 1 day ago

Description

As discussed in https://github.com/vitessio/vitess/issues/16377, this PR implements a new vtctld and corresponding vttablet RPC to allow the tags of a tablet to be changed

The new RPC supports both replacing and merging the existing tags. This merging happens on the tablet under a lock

CLI

tim@Tims-MacBook-Pro vitess % ./bin/vtctldclient ChangeTabletTags --help 2>&1 | head       
Changes the tablet tags for the specified tablet, if possible.

Tags must be specified as key=value pairs.

Usage:
  vtctldclient ChangeTabletTags <alias> <tablet-tag> [ <tablet-tag> ... ]

Flags:
  -h, --help      help for ChangeTabletTags
  -r, --replace   Replace all tablet tags with the tags provided. By default tags are merged/updated.

Related Issue(s)

https://github.com/vitessio/vitess/issues/16377

Checklist

Deployment Notes

vitess-bot[bot] commented 1 day ago

Review Checklist

Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.

General

Tests

Documentation

New flags

If a workflow is added or modified:

Backward compatibility

codecov[bot] commented 20 hours ago

Codecov Report

Attention: Patch coverage is 5.83333% with 113 lines in your changes missing coverage. Please review.

Project coverage is 69.40%. Comparing base (2e2b223) to head (03a26d1). Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
go/vt/vtctl/grpcvtctldserver/server.go 0.00% 20 Missing :warning:
go/cmd/vtctldclient/command/tablets.go 9.52% 19 Missing :warning:
go/vt/vttablet/tabletmanager/rpc_actions.go 0.00% 13 Missing :warning:
go/vt/vttablet/grpctmclient/client.go 0.00% 12 Missing :warning:
go/vt/vttablet/tmrpctest/test_tm_rpc.go 0.00% 12 Missing :warning:
go/cmd/vtctldclient/cli/tablets.go 0.00% 10 Missing :warning:
go/vt/vttablet/grpctmserver/server.go 0.00% 7 Missing :warning:
go/vt/vttablet/tabletmanager/tm_state.go 0.00% 7 Missing :warning:
go/vt/vtcombo/tablet_map.go 0.00% 5 Missing :warning:
go/vt/vtctl/grpcvtctldclient/client_gen.go 0.00% 4 Missing :warning:
... and 2 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #16857 +/- ## ========================================== - Coverage 69.43% 69.40% -0.04% ========================================== Files 1571 1571 Lines 203021 203193 +172 ========================================== + Hits 140970 141017 +47 - Misses 62051 62176 +125 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.