Skip to content

Conversation

@wk989898
Copy link
Collaborator

@wk989898 wk989898 commented Apr 7, 2025

What problem does this PR solve?

Issue Number: close #12114 close #12128

What is changed and how it works?

When a DDL operation takes a long time, the connection may be lost, even though the DDL is actually executed. Instead of throwing a failure state, we can query the downstream and wait for the DDL to complete.

Notice:

  • The add index DDL operates the same as before and does not require waiting.
  • Waiting DDL mechanism only works when downstream is TiDB and the user is at the root.

Check List

Tests

  • Unit test
  • Integration test
  • manual test
mysql> select count(*) from information_schema.ddl_jobs where CREATE_TIME >= now() - interval 10 MINUTE;
+----------+
| count(*) |
+----------+
|     9000 |
+----------+
1 row in set (0.90 sec)
mysql> SELECT JOB_ID, JOB_TYPE, SCHEMA_STATE, SCHEMA_ID, TABLE_ID, STATE, QUERY FROM information_schema.ddl_jobs where CREATE_TIME >= now()- interval 10 MINUTE;
...
...
...
9000 rows in set (0.91 sec)

Questions

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

Release note

Wait for the DDL to synchronize when meeting MySQL Invalid connection error

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Apr 7, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 7, 2025
@wk989898
Copy link
Collaborator Author

wk989898 commented Apr 7, 2025

/test pull-cdc-integration-mysql-test

@wk989898 wk989898 marked this pull request as ready for review April 8, 2025 05:44
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 8, 2025
@wk989898 wk989898 changed the title DNM: waiting the asynchronous ddl to synchronize sink(ticdc): waiting the asynchronous ddl to synchronize Apr 8, 2025
@hongyunyan hongyunyan self-requested a review April 9, 2025 03:24
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 9, 2025
Copy link
Collaborator

@hongyunyan hongyunyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 11, 2025
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 11, 2025
@asddongmen
Copy link
Contributor

Please complete the "Check List" part of this PR description. Specifically, remove the items that you didn't do and the redundant items (No code).

@asddongmen
Copy link
Contributor

Please conduct a manual test to ensure there are no performance issues when there are thousands of tables. I'm concerned about the execution time of the query: SELECT JOB_ID, JOB_TYPE, SCHEMA_STATE, SCHEMA_ID, TABLE_ID, STATE, QUERY FROM information_schema.ddl_jobs.

@wk989898
Copy link
Collaborator Author

Please conduct a manual test to ensure there are no performance issues when there are thousands of tables. I'm concerned about the execution time of the query: SELECT JOB_ID, JOB_TYPE, SCHEMA_STATE, SCHEMA_ID, TABLE_ID, STATE, QUERY FROM information_schema.ddl_jobs.

I test it with v9.0.0-beta.1.pre-nightly version, and you could find more information in pingcap/tidb#55748

@wk989898
Copy link
Collaborator Author

/retest

@ti-chi-bot ti-chi-bot bot added the lgtm label Apr 21, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Apr 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [asddongmen,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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Apr 21, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Apr 21, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-04-11 12:04:08.077966242 +0000 UTC m=+2430741.762202325: ☑️ agreed by hongyunyan.
  • 2025-04-21 07:24:31.983891754 +0000 UTC m=+254015.795682135: ☑️ agreed by asddongmen.

@wk989898
Copy link
Collaborator Author

/test pull-engine-integration-test

@ti-chi-bot ti-chi-bot bot merged commit d9a7e9f into pingcap:master Apr 22, 2025
27 checks passed
@wk989898 wk989898 deleted the wait-ddl branch April 22, 2025 03:41
@wk989898 wk989898 added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Dec 12, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #12466.
But this PR has conflicts, please resolve them!

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 Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

4 participants