dm: fix validator handling for unsigned columns (#12554)#12555
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue in the DM validator where Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Benjamin2037, OliverS929 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@OliverS929: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov Report❌ Patch coverage is Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## release-8.5 #12555 +/- ##
================================================
Coverage ? 53.3437%
================================================
Files ? 1026
Lines ? 137332
Branches ? 0
================================================
Hits ? 73258
Misses ? 58615
Partials ? 5459 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where unsigned integer columns were not handled correctly by the DM validator, leading to false-positive errors. The change involves normalizing row images using adjustValueFromBinlogData before validation, aligning the validator's behavior with the syncer. A regression test for an int unsigned primary key has been added to verify the fix. The changes look good, but I have a suggestion to improve code readability by reducing some duplication.
| if beforeImage != nil { | ||
| beforeImage, err = adjustValueFromBinlogData(beforeImage, tableInfo) | ||
| if err != nil { | ||
| return terror.Annotate(err, "failed to adjust row before image") | ||
| } | ||
| } | ||
| if afterImage != nil { | ||
| afterImage, err = adjustValueFromBinlogData(afterImage, tableInfo) | ||
| if err != nil { | ||
| return terror.Annotate(err, "failed to adjust row after image") | ||
| } | ||
| } |
|
/retest |
|
/retest |
This is an automated cherry-pick of #12554
What problem does this PR solve?
Issue Number: close #12178
What is changed and how it works?
DM validator now normalizes row images with
adjustValueFromBinlogDatabefore buildingRowChange, soUNSIGNEDvalues follow the same conversion path as syncer.This prevents high-bit
UNSIGNEDvalues from being treated as negative signed integers during row key generation and downstream validation.A regression test is added for an
int unsignedprimary key case.Check List
Tests
Questions
Will it cause performance regression or break compatibility?
No. This only reuses the existing binlog value normalization path in validator.
Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note