Add a flag to vstream to exclude keyspace from table name#18274
Merged
deepthi merged 13 commits intovitessio:mainfrom Jun 2, 2025
Merged
Add a flag to vstream to exclude keyspace from table name#18274deepthi merged 13 commits intovitessio:mainfrom
deepthi merged 13 commits intovitessio:mainfrom
Conversation
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #18274 +/- ##
==========================================
- Coverage 67.48% 67.47% -0.01%
==========================================
Files 1603 1603
Lines 262337 262397 +60
==========================================
+ Hits 177034 177053 +19
- Misses 85303 85344 +41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
deepthi
approved these changes
Jun 2, 2025
twthorn
added a commit
to slackhq/vitess
that referenced
this pull request
Jun 3, 2025
…8274) Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
This was referenced Jun 3, 2025
twthorn
added a commit
to slackhq/vitess
that referenced
this pull request
Jun 3, 2025
…8274) Signed-off-by: twthorn <thomaswilliamthornton@gmail.com>
twthorn
added a commit
to twthorn/vitess
that referenced
this pull request
Jun 6, 2025
…tessio#18274)" This reverts commit aea03ed.
twthorn
added a commit
to slackhq/vitess
that referenced
this pull request
Oct 21, 2025
…8274) Signed-off-by: Thomas Thornton <tthornton@salesforce.com>
5 tasks
tanjinx
added a commit
to slackhq/vitess
that referenced
this pull request
Oct 24, 2025
* VStream: Add flag to support copying only specific tables (vitessio#18184) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Add a flag to vstream to exclude keyspace from table name (vitessio#18274) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Fix flakey vstream metrics test (vitessio#18287) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Add support for sending grpc server backend metrics via ORCA (vitessio#18282) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * VStream: Try new tablet on purged binlog error (vitessio#18710) Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> * Run go mod tidy Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Run go fmt Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Regenerate proto files Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Fix sorting of --grpc-enable-orca-metrics flag Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Fix ordering of -grpc-enable-orca-metrics in vtcombo.txt Signed-off-by: Thomas Thornton <tthornton@salesforce.com> --------- Signed-off-by: Thomas Thornton <tthornton@salesforce.com> Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> Co-authored-by: Noble Mittal <62551163+beingnoble03@users.noreply.github.com> Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
tanjinx
added a commit
to slackhq/vitess
that referenced
this pull request
Nov 10, 2025
* VStream: Add flag to support copying only specific tables (vitessio#18184) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Add a flag to vstream to exclude keyspace from table name (vitessio#18274) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Fix flakey vstream metrics test (vitessio#18287) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Add support for sending grpc server backend metrics via ORCA (vitessio#18282) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * VStream: Try new tablet on purged binlog error (vitessio#18710) Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> * Run go mod tidy Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Run go fmt Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Regenerate proto files Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Fix sorting of --grpc-enable-orca-metrics flag Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Fix ordering of -grpc-enable-orca-metrics in vtcombo.txt Signed-off-by: Thomas Thornton <tthornton@salesforce.com> --------- Signed-off-by: Thomas Thornton <tthornton@salesforce.com> Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> Co-authored-by: Noble Mittal <62551163+beingnoble03@users.noreply.github.com> Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
sbaker617
pushed a commit
to slackhq/vitess
that referenced
this pull request
Feb 5, 2026
* VStream: Add flag to support copying only specific tables (vitessio#18184) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Add a flag to vstream to exclude keyspace from table name (vitessio#18274) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Fix flakey vstream metrics test (vitessio#18287) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Add support for sending grpc server backend metrics via ORCA (vitessio#18282) Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * VStream: Try new tablet on purged binlog error (vitessio#18710) Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> * Run go mod tidy Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Run go fmt Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Regenerate proto files Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Fix sorting of --grpc-enable-orca-metrics flag Signed-off-by: Thomas Thornton <tthornton@salesforce.com> * Fix ordering of -grpc-enable-orca-metrics in vtcombo.txt Signed-off-by: Thomas Thornton <tthornton@salesforce.com> --------- Signed-off-by: Thomas Thornton <tthornton@salesforce.com> Signed-off-by: twthorn <thomaswilliamthornton@gmail.com> Co-authored-by: Noble Mittal <62551163+beingnoble03@users.noreply.github.com> Co-authored-by: Tanjin Xu <109303790+tanjinx@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds a vstream flag to use the table name (without adding a keyspace) (and not copy/modify the vstream events received from the tablet). The goal is to optimize performance by skipping this copy step for clients that don't need it.
The benchmarked performance gain is substantial. This is because we do a deep copy of the entirety of every single row event. This may even be one of the main resource usages of vstream manager/vtgate process & could have cost savings as well.
Benchmarks
Benchmark results show 75% reduction in wall clock time to execute the same workload between exclude keyspace from table name enabled and the flag disabled disabled.
2268114250 / 9872382125 = 0.2297433609520053CPU shows 82% reduction
Using go pprof cpu profiler
Before: 1.91s (8.4%)
After: 350ms (2.6%)
Related Issue(s)
#18273
We could also, instead of wrapping in a flag, we could simply modify the original event received. This may have side effects. It also causes many unit tests to fail as they assume the passed in event is not changed. This would mean no extra flag/api changes and improve performance. Please let me know if we prefer this route and I'll put out another PR.
Note: we could add a validation check to prevent the ExcludeKeyspaceFromTableName flag from being set if there are multiple keyspaces being streamed. This could act as a safeguard. However, some clients may want the performance gain and are willing track client-side which table belongs to which keyspace. So the validation check would not be desirable in this case. Open to either option on this.
Checklist
I'll put out a doc PR once we agree on this and the naming of the flag etc.
Deployment Notes