-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Adds RPCs to vttablet that vtorc requires #10464
Conversation
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
…mi-sync settings, binlog_row_image Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
…port it Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
… stored Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
…present Signed-off-by: Manan Gupta <manan@planetscale.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
#10467 uses these introduced RPCs and verifies that they serve their purpose |
go/mysql/replication_status.go
Outdated
// FileRelayLogPosition stores the position of the source tablets binary log | ||
// upto which the IO thread has read and added to the relay log | ||
FileRelayLogPosition Position | ||
// RelayLogFilePosition stores the position in the relay log file | ||
RelayLogFilePosition Position |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two field names are confusing. It is going to be too easy to make a mistake while making changes in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, renaming the field FileRelayLogPosition
to RelayLogSourceBinLogEquivalentPosition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆
Guess that's the best we can do to avoid confusion.
I don't know whether binlog is one word - so Binlog
vs BinLog
goes to grep vitessio/vitess
OK, we use Binlog
almost everywhere except in a few test files. I know this is super-nitpicky, but could you please change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay 👍
…ayLogSourceBinLogEquivalentPosition and augment test to make sure rpc changes are backward compatible Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, the rest LGTM.
You may merge once that is addressed.
Signed-off-by: Manan Gupta <manan@planetscale.com>
* feat: add vttablet rpc to reset replication parameters Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: added end to end testing for the rpc and fixed bug Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: fix typing error Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add basic full status rpc functionality and add test for it Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add all the fields needed in full status Signed-off-by: Manan Gupta <manan@planetscale.com> * test: moved the test to reparent tests and improved it Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: bug fix for no replication status and no primary status Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add version to the full status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add binlog information to full status Signed-off-by: Manan Gupta <manan@planetscale.com> * docs: fix the comment explaining the binlog information Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add semi-sync statuses to full status Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: call the correct command Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add server uuid and id to full status Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: make server_id a uint32 to accept the correct range of values Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add few more fields to the full status like version comment, semi-sync settings, binlog_row_image Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: generate vtadmin proto files Signed-off-by: Manan Gupta <manan@planetscale.com> * test: add assertion to check binlog row format is read correctly Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: split GTID mode in its own function because mariadb doesn't support it Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: fix parsing of empty mariadb gtid set Signed-off-by: Manan Gupta <manan@planetscale.com> * docs: add doucmentation for existing fields in ReplicationStatus Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add relay log file position to the replication status output Signed-off-by: Manan Gupta <manan@planetscale.com> * test: augmented full status test to check all the different positions stored Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add additional fields to replication status and read source user Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: read sql delay from show replica status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: read ssl allowed from show replica status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: read has replication filters from show replica status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: read auto position and using gtid from show replica status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add replication lag unknown too to replication status Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: return nils from replication and primary postiion if it is not present Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: rename FileRelayLogPosition in replication status output to RelayLogSourceBinLogEquivalentPosition and augment test to make sure rpc changes are backward compatible Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: update vtadmin proto files Signed-off-by: Manan Gupta <manan@planetscale.com> * refactor: rename BinLog to binlog in renamed proto field Signed-off-by: Manan Gupta <manan@planetscale.com>
…10464) (#10546) * Adds RPCs to vttablet that vtorc requires (#10464) * feat: add vttablet rpc to reset replication parameters Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: added end to end testing for the rpc and fixed bug Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: fix typing error Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add basic full status rpc functionality and add test for it Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add all the fields needed in full status Signed-off-by: Manan Gupta <manan@planetscale.com> * test: moved the test to reparent tests and improved it Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: bug fix for no replication status and no primary status Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add version to the full status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add binlog information to full status Signed-off-by: Manan Gupta <manan@planetscale.com> * docs: fix the comment explaining the binlog information Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add semi-sync statuses to full status Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: call the correct command Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add server uuid and id to full status Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: make server_id a uint32 to accept the correct range of values Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add few more fields to the full status like version comment, semi-sync settings, binlog_row_image Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: generate vtadmin proto files Signed-off-by: Manan Gupta <manan@planetscale.com> * test: add assertion to check binlog row format is read correctly Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: split GTID mode in its own function because mariadb doesn't support it Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: fix parsing of empty mariadb gtid set Signed-off-by: Manan Gupta <manan@planetscale.com> * docs: add doucmentation for existing fields in ReplicationStatus Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add relay log file position to the replication status output Signed-off-by: Manan Gupta <manan@planetscale.com> * test: augmented full status test to check all the different positions stored Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add additional fields to replication status and read source user Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: read sql delay from show replica status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: read ssl allowed from show replica status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: read has replication filters from show replica status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: read auto position and using gtid from show replica status output Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: add replication lag unknown too to replication status Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: return nils from replication and primary postiion if it is not present Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: rename FileRelayLogPosition in replication status output to RelayLogSourceBinLogEquivalentPosition and augment test to make sure rpc changes are backward compatible Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: update vtadmin proto files Signed-off-by: Manan Gupta <manan@planetscale.com> * refactor: rename BinLog to binlog in renamed proto field Signed-off-by: Manan Gupta <manan@planetscale.com> * lint: add a new line to proto file Signed-off-by: Manan Gupta <manan@planetscale.com>
Description
This PR adds 2 new Tablet manager client RPCs that VTOrc requires -
STOP REPLICA; RESET REPLICA ALL
select @@global.server_id
select @@global.server_uuid
show replica status
show master status
select @@gtid_purged
majorVersion.minorVersion.patchRelease
select @@global.version_comment
show variables like 'read_only'
select @@global.binlog_format
select @@global.binlog_row_image
select @@global.log_bin
select @@global.log_slave_updates
select @@global.gtid_mode
show global variables like 'rpl_semi_sync_master_enabled'
show global variables like 'rpl_semi_sync_slave_enabled'
show status like 'Rpl_semi_sync_master_status'
show status like 'Rpl_semi_sync_slave_status'
show status like 'semi_sync_primary_clients'
show status like 'rpl_semi_sync_master_timeout
show status like 'rpl_semi_sync_master_wait_for_slave_count
,ReadTopologyInstanceBufferable
to collect information of the MySQL server without querying it directlyApart from these 2 RPCs, this PR also augments the ReplicationStatus struct and adds the following new fields to it -
An existing field
FileRelayLogPosition
has been renamed toRelayLogSourceBinLogEquivalentPosition
since it is a more apt variable name. The previous variable name would have been too confusing after introducingRelayLogFilePosition
A test that checks that the rpc changes are backward compatible has also been added.
Related Issue(s)
Checklist
Deployment Notes