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

ddl(ticdc): async exec add index ddl #9701

Merged
merged 13 commits into from
Sep 18, 2023

Conversation

sdojjy
Copy link
Member

@sdojjy sdojjy commented Sep 8, 2023

What problem does this PR solve?

Issue Number: close #9644

What is changed and how it works?

After this pull request, the "add index" DDL will be executed asynchronously, and it will no longer block the progression of DML replication. There is a risk associated with executing the "add index" DDL in this manner: If an error occurs during the execution of the "add index" DDL in downstream TiDB, the DDL may be lost. However, the likelihood of this situation occurring is low since the DDL was executed successfully upstream, and it will not impact the data correctness downstream.

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Questions

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

Release note

TiCDC exec adding index DDL  asynchronously and does not block checkpoint ts

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 8, 2023
@sdojjy sdojjy changed the title ddl(ticdc): Async exec add index ddl ddl(ticdc): async exec add index ddl Sep 8, 2023
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 11, 2023
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 12, 2023
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Sep 12, 2023
zap.Uint64("commitTs", ddl.CommitTs))
done <- nil
}()
for {
Copy link
Contributor

Choose a reason for hiding this comment

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

The DDL is executing in another goroutine, and this for loop looks useless, since the ticker will be triggered 1s later, so the method return, and the error channel done is not correctly checked.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

}()
for {
select {
case <-ctx.Done():
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if the ctx.Done triggered ?

Copy link
Member Author

Choose a reason for hiding this comment

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

tasks are canceled

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 15, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3AceShowHand, asddongmen

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 [3AceShowHand,asddongmen]

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 the lgtm label Sep 15, 2023
@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 15, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 15, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-12 02:52:19.488938906 +0000 UTC m=+324121.413495299: ☑️ agreed by asddongmen.
  • 2023-09-15 09:27:52.864424869 +0000 UTC m=+250438.832012918: ☑️ agreed by 3AceShowHand.

@sdojjy
Copy link
Member Author

sdojjy commented Sep 18, 2023

/test cdc-integration-mysql-test

@sdojjy
Copy link
Member Author

sdojjy commented Sep 18, 2023

/test dm-integration-test

2 similar comments
@sdojjy
Copy link
Member Author

sdojjy commented Sep 18, 2023

/test dm-integration-test

@sdojjy
Copy link
Member Author

sdojjy commented Sep 18, 2023

/test dm-integration-test

@ti-chi-bot ti-chi-bot bot merged commit bd83f8d into pingcap:master Sep 18, 2023
3 checks passed
@sdojjy sdojjy deleted the async-exec-add-index-ddl branch September 18, 2023 13:57
@nongfushanquan
Copy link
Contributor

nongfushanquan commented Oct 12, 2023

/cherry-pick release-7.1

@sdojjy sdojjy added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Oct 12, 2023
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Oct 12, 2023
@sdojjy sdojjy added the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label Oct 13, 2023
@ti-chi-bot
Copy link
Member

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

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-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Reduce the latency when replicating the "add index" ddl to the downstream(tidb)
6 participants