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

importinto: executor part of import from select #50341

Merged
merged 9 commits into from
Jan 17, 2024

Conversation

D3Hunter
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #49883

Problem Summary:

What changed and how does it work?

see title

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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 11, 2024
Copy link

tiprow bot commented Jan 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/test-infra repository.

@D3Hunter D3Hunter mentioned this pull request Jan 11, 2024
7 tasks
@@ -517,24 +516,6 @@ func NewBackend(
return nil, common.NormalizeOrWrapErr(common.ErrCreatePDClient, err)
}

shouldCreate := true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to engine-mgr, below Close part too

@D3Hunter
Copy link
Contributor Author

/test pull-lightning-integration-test

Copy link

tiprow bot commented Jan 11, 2024

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-lightning-integration-test

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/test-infra repository.

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Merging #50341 (6c1c867) into master (cfe245d) will decrease coverage by 14.5912%.
Report is 70 commits behind head on master.
The diff coverage is 76.4091%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #50341         +/-   ##
=================================================
- Coverage   70.0461%   55.4550%   -14.5912%     
=================================================
  Files          1444       1565        +121     
  Lines        419849     592639     +172790     
=================================================
+ Hits         294088     328648      +34560     
- Misses       105440     241115     +135675     
- Partials      20321      22876       +2555     
Flag Coverage Δ
integration 36.6811% <67.4321%> (?)
unit 70.1937% <55.9748%> (+0.1475%) ⬆️

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

Components Coverage Δ
dumpling 54.0269% <ø> (ø)
parser ∅ <ø> (∅)
br 56.5468% <48.8888%> (+6.8623%) ⬆️

@D3Hunter
Copy link
Contributor Author

@lance6716 @GMHDBJD

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

7 / 25 files viewed

}

if shouldCreate {
err := os.Mkdir(config.LocalStoreDir, 0o700)
Copy link
Contributor

Choose a reason for hiding this comment

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

use MkdirAll?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

copied from local backend ctor

pkg/executor/import_into.go Show resolved Hide resolved
select {
case selectedRowCh <- importer.QueryRow{
ID: idAllocator,
Data: innerChunkRow.GetDatumRow(fields),
Copy link
Contributor

Choose a reason for hiding this comment

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

if we can send a whole chk to ImportSelectedRows, after chk is finished reading we can put it back to pool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the memory footprint is not that large here, let gc handle it now.

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

11 / 25 files viewed

type chunkEncoder interface {
init() error
encodeLoop(ctx context.Context) error
logFields() []zap.Field
Copy link
Contributor

Choose a reason for hiding this comment

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

seems it's only used when task ends. In order to not let developer use it when task is running, I prefer we name it summary, summaryFields or something.

return nil
}

func (e *queryChunkEncoder) encodeLoop(ctx context.Context) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe in future we can unify it with fileChunkEncoder? Most logic is shared, the difference is how to read data.

Copy link
Contributor Author

@D3Hunter D3Hunter Jan 17, 2024

Choose a reason for hiding this comment

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

6c1c867 add a todo

Copy link
Contributor

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

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jan 17, 2024
Copy link
Contributor

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Jan 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GMHDBJD, lance6716

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

ti-chi-bot bot commented Jan 17, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-17 09:47:21.571179372 +0000 UTC m=+349283.135477061: ☑️ agreed by lance6716.
  • 2024-01-17 10:47:28.475690137 +0000 UTC m=+352890.039987839: ☑️ agreed by GMHDBJD.

@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Jan 17, 2024

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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/test-infra repository.

@ti-chi-bot ti-chi-bot bot merged commit 12d273e into pingcap:master Jan 17, 2024
28 checks passed
@D3Hunter D3Hunter deleted the imp-from-sel branch January 17, 2024 16:16
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. 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.

3 participants