[vtctld] Migrate GetSchema#7346
Conversation
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
4956ab5 to
da1437c
Compare
|
👋 I'm going to be pushing some commits to try to debug the plugin registration problem, apologies for the noise. I'll ping when I've fixed the issue. |
…the fake Signed-off-by: Andrew Mason <amason@slack-corp.com>
7a9444c to
3ee391b
Compare
|
Okay @doeg this should be good to go now! Sorry about that |
doeg
left a comment
There was a problem hiding this comment.
This looks so good and a million thank yous again for doing this. 🐶 ✨ I can't wait to add VTExplain!
The implementation looks great. I just have a question about a couple test cases. :')
| shouldErr: false, | ||
| }, | ||
| { | ||
| name: "table names take precedence over table sizes", |
There was a problem hiding this comment.
Small question to double check my read of this. 😊
The command/schema.go implementation throws an error if both are specified. For what it's worth, explicitly erroring when both flags are set seems preferable to (since it's less surprising than) implicit precedence... and I have a feeling that's why you wrote command/schema.go to error, right?
And I have a feeling that we can't return an error here, and instead have precedence behaviour, because legacy reasons?
To be clear, I think the discrepancy between the two is fine, and what you have is great. I just want to make sure I follow the difference. :)
There was a problem hiding this comment.
I think this isn't about maintaining "legacy" compatibility, but more that the options are fundamentally incompatible with each other. If I could have made the parser itself enforce the mutual exclusion, that would have been my highest preference.
I think there's an argument to be made that the server implementation itself should error in that case (instead of just relying on the CLI to catch it), but I think I would disagree on "be permissive in what you accept" kinds of reasons.
There was a problem hiding this comment.
That makes sense! I think the behaviour as you've written it is really well documented, between the protobuf comments + tests, so "surprising" was probably the wrong word. 😆 Thank you for explaining your thoughts; they are always good. :)
| } | ||
| } | ||
|
|
||
| tests := []*struct { |
There was a problem hiding this comment.
(Bah, GitHub didn't save this question + it's the only blocking question I had.)
🙈 I'm sorry to be the bearer of this question, but did you consider test cases for the tables and/or exclude_tables parameters?
I'm also wondering if it might be advantageous to mock > 1 tables for these tests.
There was a problem hiding this comment.
No because those are passed straight through to the tabletmanagerclient, so testing is that is their problem, imo
There was a problem hiding this comment.
Or I guess, "yes, I considered it; here's why I'm not" to actually answer your question 😂
There was a problem hiding this comment.
Ohhh I missed that! That makes sense, thanks.
rohit-nayak-ps
left a comment
There was a problem hiding this comment.
lgtm
things are coming together nicely :-)
[vtctld] Migrate GetSchema
[vtctld] Migrate GetSchema Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
[vtctld] Migrate GetSchema Signed-off-by: Andrew Mason <amason@slack-corp.com>
Description
This migrates the
GetSchemavtctl command to a vtctld rpc, and reimplements the old command to use the new RPC under the hood.Example:
Related Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: