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

Output Mismatch Between vtctlclient and vtctldclient #14223

Closed
mattlord opened this issue Oct 10, 2023 · 0 comments · Fixed by #14225
Closed

Output Mismatch Between vtctlclient and vtctldclient #14223

mattlord opened this issue Oct 10, 2023 · 0 comments · Fixed by #14225

Comments

@mattlord
Copy link
Contributor

mattlord commented Oct 10, 2023

Overview of the Issue

vtctldclient is replacing the legacy vtctlclient. The command names and output do at times differ — we're not trying to make them mirror each other — but we also want to align them when we can and not lose features or information.

One difference is that vtctlclient command output is generally compact, in particular when we're showing the results of protojson marshaling. vtctlclient elides zero value elements whereas vtctldclient does not. This makes a big difference in the output for some things, GetVSchema is a good simple example (although being able to show both verbose and compact output for many things would also be nice, e.g. vreplication workflow show commands).

Aside from making the transition between clients easier, in some cases the more verbose output can be much more difficult to parse/read for humans and it can make it difficult to find the relevant info you're looking for.

It would be ideal if we had an option/flag in vtctldclient so that you can get compact output for commands that would more closely align with the vtctlclient output and make it easier to find relevant info you're looking for.

Reproduction Steps

git checkout main
make build

./101_initial_cluster.sh

vtctlclient GetVSchema commerce

vtctldclient GetVSchema commerce

The output:

❯ vtctlclient GetVSchema commerce
{
  "tables": {
    "corder": {},
    "customer": {},
    "product": {}
  }
}

❯ vtctldclient GetVSchema commerce
{
  "sharded": false,
  "vindexes": {},
  "tables": {
    "corder": {
      "type": "",
      "column_vindexes": [],
      "auto_increment": null,
      "columns": [],
      "pinned": "",
      "column_list_authoritative": false,
      "source": ""
    },
    "customer": {
      "type": "",
      "column_vindexes": [],
      "auto_increment": null,
      "columns": [],
      "pinned": "",
      "column_list_authoritative": false,
      "source": ""
    },
    "product": {
      "type": "",
      "column_vindexes": [],
      "auto_increment": null,
      "columns": [],
      "pinned": "",
      "column_list_authoritative": false,
      "source": ""
    }
  },
  "require_explicit_routing": false,
  "foreign_key_mode": "FK_DEFAULT"
}

Binary Version

vtgate version Version: 19.0.0-SNAPSHOT (Git revision e5eea9c7e6973619ce4e55dec501ab81fe9d850a branch 'vtctldclient_show') built on Tue Oct 10 13:08:39 EDT 2023 by matt@pslord.local using go1.21.2 darwin/arm64

Operating System and Environment details

N/A

Log Fragments

No response

@mattlord mattlord added this to the v18.0.0 milestone Oct 10, 2023
@mattlord mattlord self-assigned this Oct 10, 2023
@mattlord mattlord changed the title Bug Report: Output Mismatch Between vtctlclient and vtctldclient Output Mismatch Between vtctlclient and vtctldclient Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant