Skip to content

schemastore: fix view DDL handling and metadata cleanup (#6568) - #6801

Merged
ti-chi-bot[bot] merged 2 commits into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-6568-to-release-8.5
Nov 5, 2026
Merged

ti-chi-bot[bot] merged 2 commits into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-6568-to-release-8.5

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #6568

What problem does this PR solve?

Issue Number: close #6548

What is changed and how it works?

Fix SchemaStore handling of view DDLs across schema initialization,
incremental replication, and database recovery.

  • Handle view renames through the DDL dispatcher, excluding view IDs from
    physical table barriers and scheduling. Avoid accessing missing table
    metadata for incrementally created views, and update existing metadata
    for views loaded from the initial snapshot.
  • Preserve the SQL statements, table information, and source names in mixed
    table/view rename events. Keep these fields aligned when individual
    renames are ignored by event filters.
  • Remove stale snapshot metadata when views are dropped or replaced, so
    subsequent table name reuse and CREATE TABLE LIKE resolve the correct
    table.
  • Retain view definitions in database recovery events while excluding view
    IDs from physical table scheduling.
  • Extend existing unit tests and the multi_tables_ddl integration case to
    cover CREATE VIEW, CREATE OR REPLACE VIEW, single and mixed renames,
    DROP VIEW, name reuse, event filtering, and database recovery. Run the
    same integration scenarios across MySQL, Kafka, storage, and Pulsar sinks.

Check List

Tests

  • Unit test
  • Integration test

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

Fix an issue where view DDLs could cause TiCDC to panic, stall replication, or retain stale schema metadata.

Signed-off-by: wk989898 <nhsmwk@gmail.com>
@ti-chi-bot ti-chi-bot added lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Nov 4, 2026
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6e31d44-58cf-4098-b9f2-0ef6306fd1ff
Commits

Reviewing files that changed from the base of the PR and between 0203bbf and fb9c1d3.

Files selected for processing: 5

  • logservice/schemastore/persist_storage_ddl_handlers.go
  • logservice/schemastore/persist_storage_test.go
  • tests/integration_tests/multi_tables_ddl/conf/normal.toml
  • tests/integration_tests/multi_tables_ddl/data/test.sql
  • tests/integration_tests/multi_tables_ddl/run.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ti-chi-bot

ti-chi-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wk989898

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added approved cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Nov 4, 2026
@ti-chi-bot
ti-chi-bot Bot merged commit 56491f5 into pingcap:release-8.5 Nov 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants