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: fix foreign key consistency under async commit #56349

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Sep 26, 2024

What problem does this PR solve?

Issue Number: close #48297

ref #23363

Problem Summary:

The foreign key consistency may be broken when an async commit DML is running concurrently with "add foreign key` DDL.

What changed and how does it work?

Add delayForAsyncCommit() before checking the foreign key.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Release note

Fix the issue that using async commit DML concurrently with add foreign key DDL may break the constraint of foreign key.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 26, 2024
@YangKeao
Copy link
Member Author

#48524 Fixed more bugs. It's prefered to merge that one.

@YangKeao YangKeao closed this Sep 27, 2024
@jiyfhust jiyfhust reopened this Oct 7, 2024
@jiyfhust
Copy link
Contributor

jiyfhust commented Oct 7, 2024

#48524 Fixed more bugs. It's prefered to merge that one.

Please go ahead on it because other bugs are not verifed yet.

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.0142%. Comparing base (7daf026) to head (95f891b).
Report is 8 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #56349        +/-   ##
================================================
+ Coverage   73.3685%   76.0142%   +2.6456%     
================================================
  Files          1624       1646        +22     
  Lines        448117     456833      +8716     
================================================
+ Hits         328777     347258     +18481     
+ Misses        99198      87948     -11250     
- Partials      20142      21627      +1485     
Flag Coverage Δ
integration 52.0899% <100.0000%> (?)
unit 72.4485% <100.0000%> (-0.0124%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9478% <ø> (ø)
parser ∅ <ø> (∅)
br 63.3007% <ø> (+17.7877%) ⬆️

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 8, 2024
@YangKeao YangKeao requested a review from tangenta October 8, 2024 08:11
… commit

Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 8, 2024
Copy link

ti-chi-bot bot commented Oct 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-10-08 08:08:02.026909616 +0000 UTC m=+947037.447122629: ☑️ agreed by tangenta.
  • 2024-10-08 09:33:06.806637432 +0000 UTC m=+952142.226850443: ☑️ agreed by jiyfhust.

Copy link

ti-chi-bot bot commented Oct 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jiyfhust, mjonss, tangenta

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:

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 merged commit d8809d1 into pingcap:master Oct 8, 2024
25 checks passed
@YangKeao YangKeao mentioned this pull request Oct 10, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is delayForAsyncCommit needed before verify records by foreign_key and constraints check?
4 participants