Skip to content
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

RFC: allow vtgate to filter tablets by tag K/Vs #15908

Open
timvaillancourt opened this issue May 9, 2024 · 2 comments · May be fixed by #15911
Open

RFC: allow vtgate to filter tablets by tag K/Vs #15908

timvaillancourt opened this issue May 9, 2024 · 2 comments · May be fixed by #15911
Assignees
Labels

Comments

@timvaillancourt
Copy link
Contributor

timvaillancourt commented May 9, 2024

Currently vtgate has support for filtering tablets, but only by keyspace/shard or key-range:

--tablet_filters strings Specifies a comma-separated list of 'keyspace|shard_name or keyrange' values to filter the tablets to watch.

This RFC proposes that vtgate supports filtering by KVs in the Tags map[string]string map of Tablet topodata.Tablet structs. This filtering would work in addition to the mutually-exclusive filters --tablet_filters and --keyspaces_to_watch

This filtering support would allow users more flexibility in routing queries from vtgate, specifically for testing upgrades, performance of new hardware, etc

I envision this support being controlled by a new tablet vtgate flag that allows a list of KVs, such as:
--tablet-filter-tags "mysql_version:8.0,instance_type:i3.xlarge". Users can apply these tag KVs using this existing vttablet flag (that adds the KVs to the Tags map[string]string of topodata.Tablet):

--init_tags StringMap (init parameter) comma separated list of key:value pairs used to tag the tablet

The existing filtering code can support a condition to filter on tablets that match these tags only

Use Case(s)

  • A user that would like to direct traffic to specific tablets using arbitrary tablet tags, for example:
    • To test upgrading to MySQL 8.x could filter by tag mysql_version:8.0
    • To test upgrading tablets to a newer Vitess release, eg: vitess_major_version:19
    • To test new hardware classes, eg: instance_type:i3.xlarge
@timvaillancourt timvaillancourt added Type: Feature Request Needs Triage This issue needs to be correctly labelled and triaged labels May 9, 2024
@timvaillancourt timvaillancourt self-assigned this May 9, 2024
@deepthi
Copy link
Member

deepthi commented May 9, 2024

I envision this support being controlled by a new tablet flag that allows a list of KVs, such as:
--tablet_filter_tags "mysql_version:8.0,instance_type:i3.xlarge".

Don't you mean "a new vtgate flag"?

@timvaillancourt
Copy link
Contributor Author

Don't you mean "a new vtgate flag"?

Whoop, yes updated 👍

@timvaillancourt timvaillancourt linked a pull request May 9, 2024 that will close this issue
5 tasks
@timvaillancourt timvaillancourt linked a pull request May 9, 2024 that will close this issue
5 tasks
@frouioui frouioui added Component: Query Serving and removed Needs Triage This issue needs to be correctly labelled and triaged labels May 13, 2024
@timvaillancourt timvaillancourt added Type: RFC Request For Comment and removed Type: Feature Request labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants