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

[vtctldserver] migrate ExecuteHook #9024

Merged
merged 6 commits into from
Oct 30, 2021

Conversation

ajm188
Copy link
Contributor

@ajm188 ajm188 commented Oct 19, 2021

Description

This migrates ExecuteHook to vtctldserver and updates the legacy commands to use it.

Related Issue(s)

Closes #9023

Checklist

  • Should this PR be backported? no
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

@@ -79,6 +80,8 @@ service Vtctld {
// EmergencyReparentShard reparents the shard to the new primary. It assumes
// the old primary is dead or otherwise not responding.
rpc EmergencyReparentShard(vtctldata.EmergencyReparentShardRequest) returns (vtctldata.EmergencyReparentShardResponse) {};
// ExecuteHook runs the hook on the tablet.
rpc ExecuteHook(vtctldata.ExecuteHookRequest) returns (tabletmanagerdata.ExecuteHookResponse);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems non-intuitive. IIUC, vtctldata.ExecuteHookRequest wraps around a tabletmanagerdata.ExecuteHookRequest. Was this done to avoid breaking cross-version compatibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I thought we did this in more places in this file, but I guess that's just vtadmin.

The reason we're wrapping around is because we need to include the tablet alias with the actual hook request for the vtctld version. Then, we wrap the alias with the tabletmanagerdata request because protobuf won't let you embed structs/messages, and I don't want to copy-paste the fields in case they drift over time.

Copy link
Member

@deepthi deepthi Oct 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok that makes sense :)

@ajm188 ajm188 force-pushed the grpcvtctldserver-migrate-executehook branch from 5598fc3 to 6f7971c Compare October 25, 2021 14:56
@ajm188 ajm188 force-pushed the grpcvtctldserver-migrate-executehook branch from 6f7971c to 9df0a29 Compare October 29, 2021 22:40
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>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
@ajm188 ajm188 force-pushed the grpcvtctldserver-migrate-executehook branch from 9df0a29 to 04039a3 Compare October 30, 2021 10:54
Protobuf messages marshal to json differently than pure Go structs, so
I'm trying this out to see that has changed things in a way that is
breaking endtoend tests

Signed-off-by: Andrew Mason <amason@slack-corp.com>
@ajm188 ajm188 merged commit 6f85a7c into vitessio:main Oct 30, 2021
@ajm188 ajm188 deleted the grpcvtctldserver-migrate-executehook branch October 30, 2021 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate ExecuteHook to VtctldServer
2 participants