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] Add RefreshState RPCs #8232

Merged
merged 6 commits into from
Jun 14, 2021

Conversation

ajm188
Copy link
Contributor

@ajm188 ajm188 commented Jun 2, 2021

Description

This PR migrates the following RPCs to VtctldServer:

  • RefreshState
  • RefreshStateByShard

I also modified the return signature of topotools.RefreshTabletsByShard to indicate whether or not every tablet was (a) discoverable and (b) did not error on its RefreshState call so that we could signal back partial success to callers.

Usage
❯ vtctldclient --server "localhost:15999" RefreshState zone1-100
Refreshed state on zone1-0000000100
❯ vtctldclient --server "localhost:15999" RefreshStateByShard commerce/0
Refreshed state on commerce/0
❯ ps aux | grep zone1-0000000102 | grep -v grep
amason           19397   1.6  0.2  5055664  83436 s011  S    10:04PM   0:01.79 vttablet -topo_implementation etcd2 -topo_global_server_address 127.0.0.1:2379 -topo_global_root /vitess/global -log_dir /Users/amason/work/vitess/vtdataroot/tmp -log_queries_to_file /Users/amason/work/vitess/vtdataroot/tmp/vttablet_0000000102_querylog.txt -tablet-path zone1-0000000102 -tablet_hostname  -init_keyspace commerce -init_shard 0 -init_tablet_type rdonly -health_check_interval 5s -enable_semi_sync -enable_replication_reporter -backup_storage_implementation file -file_backup_storage_root /Users/amason/work/vitess/vtdataroot/backups -restore_from_backup -port 15102 -grpc_port 16102 -service_map grpc-queryservice,grpc-tabletmanager,grpc-updatestream -pid_file /Users/amason/work/vitess/vtdataroot/vt_0000000102/vttablet.pid -vtctld_addr http://SFO-M-AMASON02:15000/
❯ kill -9 19397
❯ vtctldclient --server "localhost:15999" RefreshStateByShard commerce/0
Refreshed state on commerce/0
State refresh was partial; some tablets in the shard may not have succeeded.

Related Issue(s)

Knocks out two more of the items in #7135 (an oldie but a goodie).

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

@ajm188
Copy link
Contributor Author

ajm188 commented Jun 8, 2021

rebased and regenerated the protos

Copy link
Contributor

@doeg doeg left a comment

Choose a reason for hiding this comment

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

This looks good to me. Since this changes some ~ spicy call sites, I suggest an additional review from @deepthi, @rohit-nayak-ps, and/or @rafael.

Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Andrew Mason <amason@slack-corp.com>
… was only partial

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 am_vtctldserver_refresh_state_rpcs branch 2 times, most recently from fcbdc73 to 96c7457 Compare June 14, 2021 12:15
@ajm188 ajm188 merged commit 5374002 into vitessio:main Jun 14, 2021
Vtctld Service automation moved this from In progress to Done Jun 14, 2021
@ajm188 ajm188 deleted the am_vtctldserver_refresh_state_rpcs branch June 14, 2021 20:32
ajm188 added a commit to tinyspeck/vitess that referenced this pull request Jul 23, 2021
…sh_state_rpcs

[vtctldserver] Add RefreshState RPCs

Signed-off-by: Andrew Mason <amason@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants