Skip to content

[release-23.0] VReplication: Properly Handle Sequence Table Initialization For Empty Tables (#19226)#19228

Merged
mattlord merged 2 commits intorelease-23.0from
backport-19226-to-release-23.0
Jan 27, 2026
Merged

[release-23.0] VReplication: Properly Handle Sequence Table Initialization For Empty Tables (#19226)#19228
mattlord merged 2 commits intorelease-23.0from
backport-19226-to-release-23.0

Conversation

@vitess-bot
Copy link
Copy Markdown
Contributor

@vitess-bot vitess-bot bot commented Jan 26, 2026

Description

This is a backport of #19226

@vitess-bot vitess-bot bot added Type: Bug Component: VReplication Backport This is a backport Skip CI Skip CI actions from running Merge Conflict labels Jan 26, 2026
@vitess-bot
Copy link
Copy Markdown
Contributor Author

vitess-bot bot commented Jan 26, 2026

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 origin by the name of the vitessio/vitess remote

git fetch --all
gh pr checkout 19228
git reset --hard origin/release-23.0
git cherry-pick -m 1 81356abde1b477e93d7d13f69f6c57c391d340fd

@github-actions github-actions bot added this to the v23.0.1 milestone Jan 26, 2026
Signed-off-by: Matt Lord <mattalord@gmail.com>
@mattlord mattlord removed Skip CI Skip CI actions from running Merge Conflict labels Jan 27, 2026
@mattlord mattlord marked this pull request as ready for review January 27, 2026 00:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 in updateSequenceValues that 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
Copy link
Copy Markdown

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.70%. Comparing base (5321865) to head (4c5641d).
⚠️ Report is 4 commits behind head on release-23.0.

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.
📢 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.

@mattlord mattlord merged commit d3af2e8 into release-23.0 Jan 27, 2026
107 of 114 checks passed
@mattlord mattlord deleted the backport-19226-to-release-23.0 branch January 27, 2026 01:45
jwangace pushed a commit to jwangace/vitess that referenced this pull request Feb 5, 2026
…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>
jwangace pushed a commit to jwangace/vitess that referenced this pull request Feb 5, 2026
…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>
jwangace pushed a commit to jwangace/vitess that referenced this pull request Feb 5, 2026
…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>
jwangace pushed a commit to jwangace/vitess that referenced this pull request Feb 5, 2026
…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>
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.

3 participants