-
Notifications
You must be signed in to change notification settings - Fork 298
cdc(ddl): ensure strict ordering for multi-table DDLs after split #12450
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
cdc(ddl): ensure strict ordering for multi-table DDLs after split #12450
Conversation
Summary of ChangesHello @wlwilliamx, 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 a critical issue where multi-table DDL statements, such as Highlights
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
|
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.
Code Review
This pull request effectively addresses the issue of potential out-of-order execution for DDLs split from multi-table statements. By introducing a Seq field to DDLEvent, you've provided a mechanism to enforce a strict ordering for DDLs that share the same commit timestamp. The implementation across schema_storage, ddl_manager, and the model files is clean and correct. I particularly appreciate the refactoring in cdc/model/sink_gen.go which improves code reuse and maintainability for serialization logic. I have one comment regarding the manual edits in the generated file.
| err = z.DDL.DecodeMsg(dc) | ||
| if err != nil { | ||
| err = msgp.WrapError(err, "DDL") | ||
| return | ||
| } |
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.
These changes, which refactor the serialization logic for DDLEvent within RedoDDLEvent and change method receivers to pointers, are great improvements for maintainability and performance. However, since this is a generated file (as indicated by the DO NOT EDIT header), these manual changes might be lost the next time go generate is run. If the file is regenerated without these manual changes, the Seq field will not be correctly serialized for RedoDDLEvent, which could break the ordering guarantee this PR aims to provide when using redo logs. This is a potential correctness issue. Could you explore ways to make these changes permanent, perhaps by configuring the msgp generator, or add a prominent comment to the file to prevent accidental overwrites by the generator in the future?
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: asddongmen, lidezhu 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 |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
|
In response to a cherrypick label: new pull request created to branch |
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
|
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
|
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #12449
What is changed and how it works?
This PR addresses an issue where split DDLs from a multi-table
RENAMEstatement could be executed out of order downstream because they share the sameCommitTsand the order of ranging map is non-deterministic.Check List
Tests
Questions
Will it cause performance regression or break compatibility?
None
Do you need to update user documentation, design documentation or monitoring documentation?
None
Release note