-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
VReplication: Fixes for generated column handling #17107
Conversation
We were using the lowercase column name when building the list of columns to ignore but then using the case we got back from MySQL when checking the list. Signed-off-by: Matt Lord <[email protected]>
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
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17107 +/- ##
==========================================
+ Coverage 67.15% 67.18% +0.03%
==========================================
Files 1571 1571
Lines 252250 252236 -14
==========================================
+ Hits 169409 169477 +68
+ Misses 82841 82759 -82 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
resetCompression := mainClusterConfig.enableGTIDCompression() | ||
defer resetCompression() | ||
resetExperimentalFlags := setAllVTTabletExperimentalFlags() | ||
defer resetExperimentalFlags() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated to the PR issues, but I noticed that it was incorrect as I walked through this test.
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Nice updates to the test framework!
@@ -142,6 +142,11 @@ type TestQuery struct { | |||
type TestRowChange struct { | |||
before []string | |||
after []string | |||
|
|||
// If you need to customize the image you can use the raw types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Awesome, thanks for implementing this! |
Description
We were using the lowercase column name when building the map of columns to ignore in the copy phase — where we copy the filtered rows from a SELECT statement on the source — but then using the case we got back from MySQL when checking the map. h/t to @aluque01 for doing all of the hard work around this in the issue.
Without the code fix, the tests such as
TestBasicV2Workflows
fail with:The test changes added for that issue, then highlighted another issue with how we handled generated columns. Specifically when using the
binlog_row_image=noblob
MySQL setting (we added experimental support for that in #12905). The problem was that we were removing the generated column from the table's list of columns entirely in the replication plan. This then threw off the indexes used in the bitmap contained in the non-FULL binlog images which denote which columns/fields have data in the event. Without the code fixes for this issue, the tests such asTestCellAliasVreplicationWorkflow
which usebinlog_row_image=noblob
would fail when doing the vdiff after sharding tables in the product keyspace (examples here):This was because, in this specific case, we incorrectly thought that the binlog event that was generated here where only the
dec0
column was updated in all existing rows, thus resulting in MySQL eliding theblb
blob column from the ROW images in the binlog event (as it did not change), but VReplication incorrectly thinking it was there and thus assigning aNULL
value (there was in fact no value in the event for it) to it in the resultingUPDATE
statement generated.Related Issue(s)
Checklist