enable active-active check#4066
enable active-active check#4066Leavrth wants to merge 1 commit intopingcap:feature/active-activefrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
Summary of ChangesHello @Leavrth, 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 introduces a new configuration flag to fine-tune the behavior of active-active replication by allowing a bypass of certain conflict detection checks. This provides operators with more granular control over how DML events are processed in an active-active setup, potentially optimizing performance or handling specific replication scenarios. 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. 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.
Code Review
This pull request introduces a new configuration option, enable_active_active_check, to control event filtering in active-active replication scenarios. The changes are propagated through the configuration and dispatcher layers to the core event filtering logic.
My review focuses on two main points:
- Missing Validation: The new configuration lacks validation, which could lead to misconfiguration and potential issues. I've pointed out where similar validation for
enable_active_activeexists and suggested adding checks for the new flag. - Code Clarity: The implementation of the new logic in the event filtering function could be clearer. I've suggested a refactoring to improve readability and maintainability.
Overall, the changes are in the right direction, but addressing the validation point is crucial before merging.
| SyncedStatus *SyncedStatusConfig `toml:"synced-status" json:"synced-status,omitempty"` | ||
|
|
||
| EnableActiveActive *bool `toml:"enable-active-active" json:"enable-active-active,omitempty"` | ||
| EnableActiveActiveCheck *bool `toml:"enable-active-active-check" json:"enable-active-active-check,omitempty"` |
There was a problem hiding this comment.
The new configuration EnableActiveActiveCheck seems to be missing validation in ValidateAndAdjust. Given its name and its effect in EvaluateRowPolicy, it appears to be related to active-active replication.
The existing EnableActiveActive flag has several important validations, such as ensuring BDRMode is enabled, checking for a compatible sink (MySQL/TiDB), and ensuring it's not used with redo log consistency.
To prevent potential data inconsistency or runtime errors from misconfiguration, similar validations should be added for EnableActiveActiveCheck. For example:
- Should
BDRModebe required? - Is it only compatible with MySQL/TiDB sinks?
- Is it incompatible with redo log?
Please add the necessary validation logic for EnableActiveActiveCheck in the ValidateAndAdjust function.
| if enableActiveActiveCheck { | ||
| return RowPolicyKeep, nil | ||
| } |
There was a problem hiding this comment.
The logic here is a bit confusing. This check for enableActiveActiveCheck is only executed if enableActiveActive is false due to the preceding if statement. If the intention is for either flag to have the same effect of keeping the row, it would be clearer to combine them into a single condition: if enableActiveActive || enableActiveActiveCheck. While this would require changing code outside this diff, it's worth considering for better maintainability.
What problem does this PR solve?
Issue Number: close #xxx
What is changed and how it works?
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note