Skip to content
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

dm: support report error when replicate incompatible ddl #9850

Closed
GMHDBJD opened this issue Oct 10, 2023 · 0 comments · Fixed by #9856
Closed

dm: support report error when replicate incompatible ddl #9850

GMHDBJD opened this issue Oct 10, 2023 · 0 comments · Fixed by #9856
Labels
type/feature Issues about a new feature

Comments

@GMHDBJD
Copy link
Contributor

GMHDBJD commented Oct 10, 2023

Is your feature request related to a problem?

Some customers have experienced issues with upstream tools like pt-osc, which truncate the range of values during DDL changes like modifying Varchar(64) to Varchar(32), resulting in data loss. While these DDL changes might only produce warnings, there is a concern that they could execute successfully in TiDB under certain SQL modes and potentially cause downstream failures. It is advisable for DM to intercept and handle these DDL changes proactively. This approach also prevents prolonged scanning of large tables where eventual errors might occur due to data length mismatches.

Describe the feature you'd like

filters:
  rule-1:
    schema-pattern: "*"   # The name of the database for which this binlog event filter should be applied. Use "*" to indicate all databases, as needed by the user.
    table-pattern: "*"    # The name of the table for which this binlog event filter should be applied. Use "*" to indicate all tables, as needed by the user.
    events: ["incompatible_ddl_changes"]  # The binlog events to be parsed. Set to "incompatible_ddl_changes" to represent DDL changes that cause incompatibility and data inconsistency.
    action: error  # The action to be taken when this DDL is encountered. "error" indicates an error should be raised, and synchronization should stop. Other possible values are "ignore" and "do". The default value is "do".

  rule-2:
    schema-pattern: "test1"   # The name of the database for which this binlog event filter should be applied, set to "test1".
    table-pattern: "t*"    # The name of the table for which this binlog event filter should be applied, for tables starting with "t".
    events: ["Modify Column", "Value Range Decrease"]  # Represents the event types to be parsed and blocked. Here, it indicates modifying column types and reducing the value range.
    action: error  # The action to be taken when this DDL is encountered. "error" indicates an error should be raised, and synchronization should stop. Other possible values are "ignore" and "do". The default value is "do".

Describe alternatives you've considered

No response

Teachability, Documentation, Adoption, Migration Strategy

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Issues about a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant