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

planner: play replay load restore the table with foreign key with right order. #56457

Merged
merged 14 commits into from
Oct 16, 2024

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Oct 6, 2024

What problem does this PR solve?

Issue Number: close #56456

Problem Summary:

What changed and how does it work?

when restoring the table schema, some tables have these dependencies between each other. so we need to disable the ForeignKeyChecks to create table.

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.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

planner: play replay load restore the table with foreign key with right order

@hawkingrei
Copy link
Member Author

/check-issue-triage-complete

Copy link

codecov bot commented Oct 6, 2024

Codecov Report

Attention: Patch coverage is 71.79487% with 11 lines in your changes missing coverage. Please review.

Project coverage is 57.1929%. Comparing base (025c2a3) to head (ff7d806).
Report is 32 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #56457         +/-   ##
=================================================
- Coverage   73.3320%   57.1929%   -16.1391%     
=================================================
  Files          1629       1778        +149     
  Lines        449708     643471     +193763     
=================================================
+ Hits         329780     368020      +38240     
- Misses        99711     250331     +150620     
- Partials      20217      25120       +4903     
Flag Coverage Δ
integration 39.1578% <10.2564%> (?)
unit 72.5123% <71.7948%> (+0.0431%) ⬆️

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

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

@hawkingrei
Copy link
Member Author

/retest

@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 Oct 8, 2024
@hawkingrei hawkingrei marked this pull request as draft October 10, 2024 02:04
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 10, 2024
@hawkingrei hawkingrei marked this pull request as ready for review October 12, 2024 09:13
@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 Oct 12, 2024
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@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. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Oct 15, 2024
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei
Copy link
Member Author

/retest

Comment on lines 527 to 531
origin := e.Ctx.GetSessionVars().ForeignKeyChecks
e.Ctx.GetSessionVars().ForeignKeyChecks = false
defer func() {
e.Ctx.GetSessionVars().ForeignKeyChecks = origin
}()
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment for future reader

Copy link
Member Author

Choose a reason for hiding this comment

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

I have added it.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 16, 2024
Copy link
Member

@YangKeao YangKeao 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 16, 2024
Copy link

ti-chi-bot bot commented Oct 16, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-10-16 07:03:55.76817676 +0000 UTC m=+427432.917086591: ☑️ agreed by winoros.
  • 2024-10-16 07:05:50.165617936 +0000 UTC m=+427547.314527765: ☑️ agreed by YangKeao.

Copy link

ti-chi-bot bot commented Oct 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, winoros, YangKeao

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 added the approved label Oct 16, 2024
@hawkingrei
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 53a4c3e into pingcap:master Oct 16, 2024
25 checks passed
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. labels Oct 17, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 17, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 17, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Oct 17, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Oct 21, 2024
@hawkingrei
Copy link
Member Author

/cherrypick release-7.1

@hawkingrei hawkingrei deleted the 56456 branch November 4, 2024 06:53
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 4, 2024
@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-7.1: #57098.

In response to this:

/cherrypick release-7.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

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-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.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.

play replay load cannot restore the table with foreign key
5 participants