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

Use replica queries when available #15808

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

dbussink
Copy link
Contributor

@dbussink dbussink commented Apr 29, 2024

This switches things over to use the replica syntax when available instead of the deprecated style.

Related Issue(s)

Part of #9515. The new naming is not available for all of MySQL 8.0, so we have to carry the legacy still but we can use the new syntax moving forward where possible.

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Copy link
Contributor

vitess-bot bot commented Apr 29, 2024

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Apr 29, 2024
@github-actions github-actions bot added this to the v20.0.0 milestone Apr 29, 2024
@dbussink
Copy link
Contributor Author

Not all end-to-end tests here have been updated yet either, that's still pending to change to use the new syntax when available as well.

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 53.36427% with 201 lines in your changes are missing coverage. Please review.

Project coverage is 68.39%. Comparing base (cf3acaa) to head (fbb3c48).
Report is 2 commits behind head on main.

Files Patch % Lines
go/mysql/flavor_mysql.go 50.35% 70 Missing ⚠️
go/vt/vttablet/tabletmanager/rpc_replication.go 9.37% 29 Missing ⚠️
go/vt/mysqlctl/replication.go 34.37% 21 Missing ⚠️
go/vt/mysqlctl/fakemysqldaemon.go 46.66% 16 Missing ⚠️
go/vt/vttablet/tabletmanager/restore.go 0.00% 16 Missing ⚠️
go/cmd/vtbackup/cli/vtbackup.go 0.00% 7 Missing ⚠️
go/mysql/flavor_filepos.go 0.00% 7 Missing ⚠️
go/vt/vtgate/executor.go 65.00% 7 Missing ⚠️
go/mysql/flavor_mariadb.go 76.00% 6 Missing ⚠️
go/mysql/replication.go 72.72% 6 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15808      +/-   ##
==========================================
- Coverage   68.41%   68.39%   -0.03%     
==========================================
  Files        1558     1558              
  Lines      196353   196547     +194     
==========================================
+ Hits       134337   134422      +85     
- Misses      62016    62125     +109     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbussink dbussink force-pushed the dbussink/use-replica-commands branch 3 times, most recently from 0449d9b to e7a61bb Compare April 29, 2024 14:51
@dbussink dbussink added Type: Internal Cleanup Component: General Changes throughout the code base and removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Apr 29, 2024
@dbussink dbussink force-pushed the dbussink/use-replica-commands branch 3 times, most recently from b4579a8 to 21ac30d Compare April 30, 2024 07:28
This switches things over to use the replica syntax when available
instead of the deprecated style.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
@dbussink dbussink force-pushed the dbussink/use-replica-commands branch 2 times, most recently from a5aca74 to dffc19e Compare April 30, 2024 08:35
Copy link
Contributor

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

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

See inline comments

go/mysql/flavor_mysql.go Show resolved Hide resolved
go/mysql/flavor_mysql.go Show resolved Hide resolved
go/mysql/flavor_mysql.go Show resolved Hide resolved
go/mysql/flavor_mysql.go Show resolved Hide resolved
go/mysql/replication/replication_status.go Show resolved Hide resolved
go/vt/mysqlctl/query.go Show resolved Hide resolved
go/mysql/replication.go Outdated Show resolved Hide resolved
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Copy link
Contributor

@mattlord mattlord left a comment

Choose a reason for hiding this comment

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

LGTM! I only had minor nits/comments/suggestions.

Thank you for doing this!

go/mysql/capabilities/capability.go Outdated Show resolved Hide resolved
go/mysql/flavor.go Outdated Show resolved Hide resolved
go/mysql/flavor.go Outdated Show resolved Hide resolved
go/mysql/flavor_mysql.go Outdated Show resolved Hide resolved
go/mysql/replication.go Outdated Show resolved Hide resolved
go/mysql/replication/replication_status.go Show resolved Hide resolved
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
@dbussink dbussink merged commit ba0dfa4 into vitessio:main Apr 30, 2024
104 checks passed
@dbussink dbussink deleted the dbussink/use-replica-commands branch April 30, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: General Changes throughout the code base Type: Internal Cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants