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: change interface of lightning package wrappers #53233

Merged
merged 13 commits into from
May 16, 2024

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented May 13, 2024

What problem does this PR solve?

Issue Number: close #53165

Problem Summary:

What changed and how does it work?

  • Every litBackendCtx should manage one DDL job, no need to use DDL job related fields as interface arguments. They are only needed when construct the litBackendCtx.
  • limit the functionality of BackendCtx.Register , please see the comment. And separate FinishedWritingNeedImport
  • fix local + disttask fast reorg pipeline forget to unregister engines
  • remove the worker limit 16 per engineInfo
  • update the timing of usage memRoot

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.

Existing tests failed and revealed some wrong change during development. Now they are all passed

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

Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 13, 2024
Copy link

tiprow bot commented May 13, 2024

Hi @lance6716. 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.

Signed-off-by: lance6716 <lance6716@gmail.com>
Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 52 lines in your changes are missing coverage. Please review.

Project coverage is 75.0356%. Comparing base (fa94f49) to head (01272f0).
Report is 33 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53233        +/-   ##
================================================
+ Coverage   72.4109%   75.0356%   +2.6246%     
================================================
  Files          1493       1498         +5     
  Lines        429341     437940      +8599     
================================================
+ Hits         310890     328611     +17721     
+ Misses        99162      89246      -9916     
- Partials      19289      20083       +794     
Flag Coverage Δ
integration 49.6055% <71.9457%> (?)
unit 71.5091% <24.8868%> (+0.2063%) ⬆️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.1978% <ø> (+8.7609%) ⬆️

Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
@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 May 13, 2024
Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716
Copy link
Contributor Author

/ok-to-test

Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716 lance6716 changed the title [WIP]ddl: change interface of lightning package wrappers ddl: change interface of lightning package wrappers May 14, 2024
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-tests-checked labels May 14, 2024
return false
}
for _, ei := range bc.engines {
return ei.closedEngine != nil
Copy link
Contributor

Choose a reason for hiding this comment

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

What if some of the engines are closed, others are not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

rest lgtm

Copy link
Contributor

@D3Hunter D3Hunter left a comment

Choose a reason for hiding this comment

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

rest lgtm

pkg/ddl/ingest/engine_mgr.go Outdated Show resolved Hide resolved
Comment on lines 197 to 199
for _, fn := range unlockFn {
fn()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

unlock in defer to make sure released on panic?

why not lock/unlock it inside ei.Flush()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why not lock/unlock it inside ei.Flush()

The old behaviour is that lock is hold when unsafeImportAndReset, I need more time to understand if only hold the lock for ei.Flush() is enough

pkg/ddl/ingest/engine.go Outdated Show resolved Hide resolved
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
@hawkingrei
Copy link
Member

/test all

@lance6716
Copy link
Contributor Author

/retest

Copy link

ti-chi-bot bot commented May 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, 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

Copy link

ti-chi-bot bot commented May 16, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-15 11:14:53.856990572 +0000 UTC m=+1651847.614126145: ☑️ agreed by D3Hunter.
  • 2024-05-16 05:48:57.548660593 +0000 UTC m=+1718691.305796165: ☑️ agreed by tangenta.

@ti-chi-bot ti-chi-bot bot merged commit cc127c1 into pingcap:master May 16, 2024
23 checks passed
terry1purcell pushed a commit to terry1purcell/tidb that referenced this pull request May 17, 2024
RidRisR pushed a commit to RidRisR/tidb that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test release-note-none size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multi-schema-change fast reorg has no chance to save checkpoint
4 participants