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: clear MDL related tables for create view #53944

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

D3Hunter
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #53246

Problem Summary:

What changed and how does it work?

  • DDL shouldn't lock MDL, there is only 1 DDL which locks MDL now: create view as select xx, create table also has for syntax for as select, but it's not implemented.
  • after ddl: manage job lifecycle in worker #53747, general ddl worker will be held until the job enters final state, for a sequence of general DDLs of 1. alter table a add column xxx; 2. create view v as select * from a, they will block each other if we don't clear the MDL. also see ddl: manage job lifecycle in worker #53747 (comment)

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.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 11, 2024
Copy link

tiprow bot commented Jun 11, 2024

Hi @D3Hunter. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 kubernetes-sigs/prow repository.

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.7643%. Comparing base (fedf3b7) to head (cd86369).
Report is 9 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #53944         +/-   ##
=================================================
- Coverage   72.5455%   55.7643%   -16.7813%     
=================================================
  Files          1508       1628        +120     
  Lines        431744     603533     +171789     
=================================================
+ Hits         313211     336556      +23345     
- Misses        99128     243840     +144712     
- Partials      19405      23137       +3732     
Flag Coverage Δ
integration 37.2722% <75.0000%> (?)
unit 71.4370% <100.0000%> (-0.0981%) ⬇️

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 50.3986% <ø> (+8.2519%) ⬆️

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 12, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 12, 2024
Copy link

ti-chi-bot bot commented Jun 12, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-12 02:44:32.854997243 +0000 UTC m=+519026.908309165: ☑️ agreed by tangenta.
  • 2024-06-12 07:01:51.341892851 +0000 UTC m=+534465.395204775: ☑️ agreed by lance6716.

@@ -228,3 +228,38 @@ func TestUpgradingRelatedJobState(t *testing.T) {
dom.DDL().StateSyncer().UpdateGlobalState(context.Background(), &syncer.StateInfo{State: syncer.StateNormalRunning})
}
}

func TestGeneralDDLWithQuery(t *testing.T) {
store, _ := testkit.CreateMockStoreAndDomain(t)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
store, _ := testkit.CreateMockStoreAndDomain(t)
store := testkit.CreateMockStore(t)

@easonn7
Copy link

easonn7 commented Jun 12, 2024

/approve

Copy link

ti-chi-bot bot commented Jun 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: easonn7, hawkingrei, lance6716, tangenta, wjhuang2016

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 Jun 12, 2024
@ti-chi-bot ti-chi-bot bot merged commit 7b8c91d into pingcap:master Jun 12, 2024
22 of 23 checks passed
@D3Hunter D3Hunter deleted the clear-mdl-for-cview branch June 13, 2024 02:03
@D3Hunter D3Hunter mentioned this pull request Jun 17, 2024
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner 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.

6 participants