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

lightning: reuse dupDetector to implement in-memory ingest data #46270

Merged
merged 6 commits into from
Aug 23, 2023

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Aug 21, 2023

What problem does this PR solve?

Issue Number: ref #45719

Problem Summary:

What is changed and how it works?

to reuse local backend's logic, we need to let external engine implement IngestData interface. We can simple do it by loading KV pairs from external engine into memory. And to implement the duplicate detection feature, I extract DupDetector to let local engine and external engine use same code.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

master

goos: darwin
goarch: arm64
pkg: github.com/pingcap/tidb/br/pkg/lightning/backend/local
BenchmarkDupDetectIter
BenchmarkDupDetectIter-8   	       4	 310411136 ns/op

this branch

goos: darwin
goarch: arm64
pkg: github.com/pingcap/tidb/br/pkg/lightning/backend/local
BenchmarkDupDetectIter
BenchmarkDupDetectIter-8   	       4	 317531698 ns/op

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-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 21, 2023
@tiprow
Copy link

tiprow bot commented Aug 21, 2023

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

@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #46270 (4bdb164) into master (b1f0880) will decrease coverage by 0.6997%.
Report is 28 commits behind head on master.
The diff coverage is 73.3333%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46270        +/-   ##
================================================
- Coverage   73.3765%   72.6768%   -0.6997%     
================================================
  Files          1285       1305        +20     
  Lines        394535     399581      +5046     
================================================
+ Hits         289496     290403       +907     
- Misses        86609      90736      +4127     
- Partials      18430      18442        +12     
Flag Coverage Δ
integration 25.6504% <0.0000%> (?)
unit 73.3525% <73.3333%> (-0.0240%) ⬇️

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 85.0775% <ø> (+0.0118%) ⬆️
br 47.9591% <73.3333%> (-4.2933%) ⬇️

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 Aug 21, 2023
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716 lance6716 changed the title [WIP]lightning: reuse dupDetector [WIP]lightning: reuse dupDetector to implement in-memory ingest data Aug 21, 2023
Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716 lance6716 changed the title [WIP]lightning: reuse dupDetector to implement in-memory ingest data lightning: reuse dupDetector to implement in-memory ingest data Aug 21, 2023
@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 Aug 21, 2023
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

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 22, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 23, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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:
  • OWNERS [tangenta,wjhuang2016]

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 Aug 23, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 23, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-22 09:36:08.043856089 +0000 UTC m=+1228532.592872081: ☑️ agreed by tangenta.
  • 2023-08-23 04:31:57.435965855 +0000 UTC m=+1296681.984981839: ☑️ agreed by wjhuang2016.

@ti-chi-bot ti-chi-bot bot merged commit 6169cce into pingcap:master Aug 23, 2023
12 of 21 checks passed
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