Full Status tab improvements for VTAdmin#11470
Conversation
…de the io and sql state from integers to strings Signed-off-by: Manan Gupta <manan@planetscale.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Signed-off-by: Manan Gupta <manan@planetscale.com>
ajm188
left a comment
There was a problem hiding this comment.
LGTM, but a question about the presentation :)
|
I left a few suggestions for cleaning up the code 😄 Potentially the swaps from integer --> human readable state could be done at the API level in the future - since there could be multiple clients for this API. |
This would be preferable so that we don't have to keep two places in sync. However, I suspect that because we are returning a protobuf from the RPC, we don't have much of a choice. |
Signed-off-by: Manan Gupta <manan@planetscale.com>
…-output Signed-off-by: Manan Gupta <manan@planetscale.com>
|
@notfelineit Thank-you for all the suggestions! I have fixed them all up. @deepthi is right about the reason why I implemented the changes in the typescript side instead of the API. In the typescript code, we also verify that we indeed get the result matching the fields of the proto message and their types. |
|
I was unable to backport this Pull Request to the following branches: |
* feat: add replacer and code to always print semi-sync fields and decode the io and sql state from integers to strings Signed-off-by: Manan Gupta <manan@planetscale.com> * refactor: prettify the changed file Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: fix replication state strings and simplify code Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com>
|
@deepthi @GuptaManan100 that makes sense regarding the API proto! This looks good! |
* feat: add replacer and code to always print semi-sync fields and decode the io and sql state from integers to strings Signed-off-by: Manan Gupta <manan@planetscale.com> * refactor: prettify the changed file Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: fix replication state strings and simplify code Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com>

Description
The PR #11438 introduced the
Full Statustab in the vttablets in VTAdmin which shows the full replication status of the tablets.In this output it was noticed that the IO state and SQL state are printed as integers (because they are stored as an enum), instead of any meaningful output, so it becomes hard for the users to read this data unless they are familiar with Vitess internals on how the enum works.
This PR attempts to improve this situation by decoding these values before printing them using a replacer function in the
json.Stringify.Another thing that was noticed was that the semi-sync properties weren't printed if they are false. This is not desirable. We instead always want to print these settings. This PR addresses this too. It checks for these fields being explicitly set to true. If they aren't, then we set them to false.
Here are the images of the Full Status tab after the changes -
Related Issue(s)
Checklist
Deployment Notes