Skip to content

Add a new implementation for handling multiple queries without needing to split them#18059

Merged
GuptaManan100 merged 25 commits intovitessio:mainfrom
planetscale:split-vtgate
Apr 9, 2025
Merged

Add a new implementation for handling multiple queries without needing to split them#18059
GuptaManan100 merged 25 commits intovitessio:mainfrom
planetscale:split-vtgate

Conversation

@GuptaManan100
Copy link
Contributor

@GuptaManan100 GuptaManan100 commented Mar 27, 2025

Description

This PR adds the ability described in #18094. With the changes in this PR -

  1. It is possible to run multiple queries against vtgate via a single RPC call ExecuteMulti and StreamExecuteMulti

This allows users to be able to import the connection code, and send the queries down to vtgate without splitting them up on their side like they used to before. Since this is a new feature that introduces RPCs it is not immediately backward compatible. So, we've put this feature behind a flag and users need to explicitly opt into it, if they want this behaviour.

Related Issue(s)

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

Deployment Notes

…d execute multi

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>
@vitess-bot
Copy link
Contributor

vitess-bot bot commented Mar 27, 2025

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 Mar 27, 2025
@github-actions github-actions bot added this to the v22.0.0 milestone Mar 27, 2025
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
@codecov
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 22.54464% with 347 lines in your changes missing coverage. Please review.

Project coverage is 67.48%. Comparing base (8ee1f29) to head (2d6f60d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
go/mysql/conn.go 4.30% 89 Missing ⚠️
go/vt/vtgate/plugin_mysql_server.go 0.00% 72 Missing ⚠️
go/vt/vtgate/vtgate.go 0.00% 55 Missing ⚠️
go/cmd/vtgateclienttest/services/callerid.go 0.00% 29 Missing ⚠️
go/cmd/vtgateclienttest/services/echo.go 0.00% 29 Missing ⚠️
go/cmd/vtgateclienttest/services/errors.go 0.00% 29 Missing ⚠️
go/mysql/fakesqldb/server.go 0.00% 16 Missing ⚠️
go/vt/vtgate/grpcvtgateservice/server.go 73.91% 12 Missing ⚠️
go/cmd/vtgateclienttest/services/fallback.go 0.00% 4 Missing ⚠️
go/cmd/vtgateclienttest/services/terminal.go 0.00% 4 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18059      +/-   ##
==========================================
- Coverage   67.56%   67.48%   -0.08%     
==========================================
  Files        1601     1601              
  Lines      261416   261861     +445     
==========================================
+ Hits       176618   176712      +94     
- Misses      84798    85149     +351     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
@frouioui frouioui modified the milestones: v22.0.0, v23.0.0 Apr 1, 2025
@GuptaManan100 GuptaManan100 added Type: Feature Component: Query Serving 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 2, 2025
@GuptaManan100 GuptaManan100 marked this pull request as ready for review April 2, 2025 09:10
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>
…ing a callback

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>
Copy link
Member

@harshit-gangal harshit-gangal left a comment

Choose a reason for hiding this comment

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

I think we should add e2e test for grpc client and server implementation. It can go in here: go/test/endtoend/vtgate/grpc_api

@harshit-gangal harshit-gangal self-requested a review April 8, 2025 16:25
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
@GuptaManan100 GuptaManan100 added the Backport to: release-22.0 Needs to be backport to release-22.0 label Apr 9, 2025
@GuptaManan100 GuptaManan100 merged commit f36c872 into vitessio:main Apr 9, 2025
102 checks passed
@GuptaManan100 GuptaManan100 deleted the split-vtgate branch April 9, 2025 07:43
vitess-bot pushed a commit that referenced this pull request Apr 9, 2025
…g to split them (#18059)

Signed-off-by: Manan Gupta <manan@planetscale.com>
GuptaManan100 pushed a commit that referenced this pull request Apr 9, 2025
… without needing to split them (#18059) (#18139)

Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
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.

Feature Request: Push SplitStatements down the stack and add RPC to run multiple queries together

4 participants