[release-23.0] VReplication: Properly Handle Sequence Table Initialization For Empty Tables (#19226)#19228
Conversation
|
Hello @mattlord, there are conflicts in this backport. Please address them in order to merge this Pull Request. You can execute the snippet below to reset your branch and resolve the conflict manually. Make sure you replace |
Signed-off-by: Matt Lord <mattalord@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR is a backport of #19226 to the release-23.0 branch. It fixes a bug where VReplication sequence table initialization was incorrectly skipped when the source tables were empty (had a max value of 0). The fix removes the problematic check that prevented initialization of sequences with a max value of 0, and adds comprehensive test coverage for this scenario.
Changes:
- Removed the
if maxValue == 0 { continue }check inupdateSequenceValuesthat caused empty tables to skip sequence initialization - Refactored the test to use a table-driven approach with two test cases: one for tables with data (original case) and one for empty tables (new case)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| go/vt/vtctl/workflow/sequences.go | Removed the problematic skip condition for zero max values, allowing proper sequence initialization for empty tables |
| go/vt/vtctl/workflow/sequences_test.go | Refactored test to table-driven format and added comprehensive test case for empty table initialization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-23.0 #19228 +/- ##
================================================
- Coverage 69.70% 69.70% -0.01%
================================================
Files 1606 1606
Lines 214599 214618 +19
================================================
+ Hits 149590 149603 +13
- Misses 65009 65015 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ation For Empty Tables (vitessio#19226) (vitessio#19228) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com>
…ation For Empty Tables (vitessio#19226) (vitessio#19228) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Jun Wang <jun.wang@demonware.net>
…ation For Empty Tables (vitessio#19226) (vitessio#19228) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Jun Wang <jun.wang@demonware.net>
…ation For Empty Tables (vitessio#19226) (vitessio#19228) Signed-off-by: Matt Lord <mattalord@gmail.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Jun Wang <jun.wang@demonware.net>
Description
This is a backport of #19226