Skip to content

Conversation

wlwilliamx
Copy link
Contributor

@wlwilliamx wlwilliamx commented Dec 5, 2024

What problem does this PR solve?

Issue Number: close #11816

What is changed and how it works?

PR Description

This PR updates TiCDC to align its DDL handling logic with TiDB v8.3.0’s changes to the enable_fast_create_table feature, improving efficiency and simplifying the architecture.

Background

In TiDB versions prior to v8.3.0:

  • When enable_fast_create_table=on, batch create tables DDL jobs transitioned directly to the JobStateSynced state, bypassing the JobStateDone state.
  • Batch create tables DDL jobs were written only to the tidb_ddl_history table in the JobStateSynced state.

As of TiDB v8.3.0:

  • Batch create tables DDL jobs now follow the same lifecycle as other DDL jobs, including the JobStateDone state.
  • These jobs are written to the tidb_ddl_job table, making the tidb_ddl_history table unnecessary for TiCDC.

For more details, see issue #11816.

Changes in This PR

1. Process Only JobStateDone DDL Jobs
  • TiCDC now exclusively handles JobStateDone DDL jobs for create table operations.
  • Removes special handling for the JobStateSynced state, simplifying the DDL processing logic.
2. Stop Monitoring tidb_ddl_history
  • TiCDC no longer monitors the tidb_ddl_history table for DDL changes.
  • Reverts to the pre-enable_fast_create_table architecture.
3. Resolve Redundant DDL Processing
4. Reduce Latency
  • By processing JobStateDone DDL jobs directly, this change avoids delays introduced by waiting for the JobStateSynced state transition.

Check List

Tests

  • Unit test
  • Integration test

Questions

Will it cause performance regression or break compatibility?

No.

Do you need to update user documentation, design documentation or monitoring documentation?

No.

Release note

None

…tory instead of tidb_ddl_job table (pingcap#10907)"

This reverts commit 8d6a9e1.
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 5, 2024
@wlwilliamx wlwilliamx changed the title ddl(ticdc): process only JobStateDone DDL jobs and remove the need to monitor the tidb_ddl_history ddl(ticdc): process only JobStateDone DDL jobs and remove the need to capture the tidb_ddl_history Dec 5, 2024
@wlwilliamx
Copy link
Contributor Author

/cc @asddongmen @hongyunyan

@ti-chi-bot ti-chi-bot bot requested review from asddongmen and hongyunyan December 6, 2024 07:37
@wlwilliamx
Copy link
Contributor Author

/test cdc-integration-storage-test

@wlwilliamx
Copy link
Contributor Author

/test cdc-integration-mysql-test

@wlwilliamx
Copy link
Contributor Author

/test dm-integration-test

@wlwilliamx
Copy link
Contributor Author

/retest

@wlwilliamx wlwilliamx force-pushed the fix/only-handle-done-state-ddl branch from 295de41 to 55bca14 Compare December 12, 2024 08:39
@wlwilliamx
Copy link
Contributor Author

/retest

@wlwilliamx
Copy link
Contributor Author

/test cdc-integration-kafka-test

@wlwilliamx
Copy link
Contributor Author

/test dm-integration-test

1 similar comment
@wlwilliamx
Copy link
Contributor Author

/test dm-integration-test

@wlwilliamx
Copy link
Contributor Author

/test cdc-integration-kafka-test

@wlwilliamx
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 20, 2024
Copy link
Contributor

ti-chi-bot bot commented Dec 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CharlesCheung96, hongyunyan

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CharlesCheung96,hongyunyan]

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 20, 2024
Copy link
Contributor

ti-chi-bot bot commented Dec 20, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-20 09:32:51.320053654 +0000 UTC m=+1208561.408856196: ☑️ agreed by CharlesCheung96.
  • 2024-12-20 09:37:39.842059473 +0000 UTC m=+1208849.930862015: ☑️ agreed by hongyunyan.

@CharlesCheung96 CharlesCheung96 added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Dec 20, 2024
@wlwilliamx
Copy link
Contributor Author

/test verify

@wlwilliamx
Copy link
Contributor Author

/retest

1 similar comment
@wlwilliamx
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit d07fcd1 into pingcap:master Dec 20, 2024
26 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #11915.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aligning TiCDC DDL Handling with TiDB v8.3.0’s enable_fast_create_table Behavior
4 participants