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

Feature Request: Add hint to support routing queries to vttablet by tablet alias #225

Open
earayu opened this issue Aug 2, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@earayu
Copy link
Collaborator

earayu commented Aug 2, 2023

Issue Content:

Currently, WeSQL-Scale supports routing queries to vttablets using keyspace, shard, and tablet types as routing keys. However, it would be beneficial to enhance the query routing mechanism by adding support for routing queries to vttablets using tablet aliases.

We propose the following feature request:

  1. Support Query Routing by Tablet Alias: Modify WeSQL-Scale to allow routing queries to a specific vttablet using its tablet alias as an additional routing key. This would provide more flexibility in directing queries to specific tablets within a shard.

With this feature, users will have the ability to precisely control query routing to vttablets, which can prove useful in scenarios where specific tablets need to handle certain types of queries or for targeted troubleshooting.

We appreciate your valuable feedback and suggestions on this feature request.

@earayu earayu added the enhancement New feature or request label Aug 2, 2023
@earayu earayu added good first issue Good for newcomers help wanted Extra attention is needed labels Aug 30, 2023
@jairuigou
Copy link
Contributor

I'll try this

@jairuigou jairuigou self-assigned this Sep 6, 2023
@earayu
Copy link
Collaborator Author

earayu commented Sep 6, 2023

Users can get tablet alias by show vitess_tablets

mysql> show vitess_tablets;
+-------+----------+-------+------------+---------+------------------+----------------------------------+----------------------+
| Cell  | Keyspace | Shard | TabletType | State   | Alias            | Hostname                         | PrimaryTermStartTime |
+-------+----------+-------+------------+---------+------------------+----------------------------------+----------------------+
| zone1 | mysql    | 0     | PRIMARY    | SERVING | zone1-0000000101 | yuguanghuidebijibendiannao.local | 2023-09-05T09:40:14Z |
| zone1 | mysql    | 0     | REPLICA    | SERVING | zone1-0000000102 | yuguanghuidebijibendiannao.local |                      |
| zone1 | mysql    | 0     | REPLICA    | SERVING | zone1-0000000100 | yuguanghuidebijibendiannao.local |                      |
+-------+----------+-------+------------+---------+------------------+----------------------------------+----------------------+
3 rows in set (0.00 sec)

The hint may look like this:

SELECT /*vt+ TABLET_ALIAS=zone1-0000000101 */ * FROM user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants