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: Sort results of GetTablets so that ListShardTablets is more easily readable/parseable by humans #17744

Closed
lmorduch opened this issue Feb 11, 2025 · 3 comments
Assignees
Labels
Component: vtctldclient Type: Enhancement Logical improvement (somewhere between a bug and feature)

Comments

@lmorduch
Copy link
Contributor

Feature Description

What is the change?

I'm fairly dependent on the ListShardTablets command in my daily workflow. Currently, the order in which the results are listed is non-deterministic, which makes it difficult to scan the results quickly and consistently. It would be nice to be able to deterministically guarantee order by sorting before returning.

Where would it go?

I'm thinking about adding the change within this function:

return &vtctldatapb.GetTabletsResponse{

Potential Options

To start, I'll probably just submit a default ordering that will order alphabetically by alias. However, if desired we could make this optional behavior and potentially allow for some control over how sorting happens.

Use Case(s)

When calling ListShardTablet, especially multiple times in quick succession, I will be able to scan and grok the results much more easily since they will be returned in an expected and consistent order.

@lmorduch lmorduch added the Needs Triage This issue needs to be correctly labelled and triaged label Feb 11, 2025
@mattlord mattlord added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: vtctldclient and removed Needs Triage This issue needs to be correctly labelled and triaged labels Feb 12, 2025
@mattlord
Copy link
Contributor

Hi @lmorduch !

To start, I'll probably just submit a default ordering that will order alphabetically by alias

That sounds good. I thought that we already did that, but perhaps not.

Just FYI, the legacy vtctlclient binary was deprecated in v18 and will be removed in v23. vtctldclient GetTablets is the new equivalent command: https://vitess.io/docs/reference/vtctldclient-transition/

That command does use the noted VtctldServer RPC: https://github.com/vitessio/vitess/blob/main/go/cmd/vtctldclient/command/tablets.go

I assigned this to you for now as you seemed to be interested in opening a PR. Please let me know if I'm mistaken on that point and I'll remove you as the assignee. Please let me know if you need any help.

Thanks again!

@lmorduch
Copy link
Contributor Author

lmorduch commented Feb 12, 2025

Hi @lmorduch !

To start, I'll probably just submit a default ordering that will order alphabetically by alias

That sounds good. I thought that we already did that, but perhaps not.

Just FYI, the legacy vtctlclient binary was deprecated in v18 and will be removed in v23. vtctldclient GetTablets is the new equivalent command: https://vitess.io/docs/reference/vtctldclient-transition/

That command does use the noted VtctldServer RPC: https://github.com/vitessio/vitess/blob/main/go/cmd/vtctldclient/command/tablets.go

I assigned this to you for now as you seemed to be interested in opening a PR. Please let me know if I'm mistaken on that point and I'll remove you as the assignee. Please let me know if you need any help.

Thanks again!

Awesome, thank you for taking a look and the pointers/context! I'll make sure to update the commands I'm using as I upgrade to vtctldclient.

I'm definitely down to implement, should have a PR soon!

@dbussink
Copy link
Contributor

Implemented in #17771.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: vtctldclient Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

No branches or pull requests

3 participants