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

global sort: new merge with 1 writer #49474

Merged
merged 12 commits into from
Dec 19, 2023
Merged

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Dec 14, 2023

What problem does this PR solve?

Issue Number: ref #48779

Problem Summary:

What changed and how does it work?

Implement new merge step. In new implementation, mergeIter is abandoned.
The new merge step process data from startKey to endKey, using datas and stats.

  1. use rangeSplitter to split range groups to read data.
  2. read range data then sort them.
  3. write all data to only one file.

Currently, the new merge step use only 1 writer.

TODO:

  1. We can speed up the process using multiple worker doing the merge process later.
  2. Add more bench test after gcs parallel writer stable.
  3. integrate with add index and import into.
  4. See if the new merge step can handle more files.

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 do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 14, 2023
Copy link

tiprow bot commented Dec 14, 2023

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

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Merging #49474 (5a17c4a) into master (d076bc1) will increase coverage by 0.5412%.
Report is 30 commits behind head on master.
The diff coverage is 0.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #49474        +/-   ##
================================================
+ Coverage   70.9870%   71.5282%   +0.5412%     
================================================
  Files          1368       1420        +52     
  Lines        399790     421695     +21905     
================================================
+ Hits         283799     301631     +17832     
- Misses        96179     101202      +5023     
+ Partials      19812      18862       -950     
Flag Coverage Δ
integration 43.6515% <0.0000%> (?)
unit 70.9867% <ø> (-0.0003%) ⬇️

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

Components Coverage Δ
dumpling 53.9663% <ø> (ø)
parser ∅ <ø> (∅)
br 47.4501% <0.0000%> (-5.4348%) ⬇️

@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 15, 2023
@ywqzzy ywqzzy changed the title wip: Portmerge global sort: new merge with 1 writer Dec 15, 2023
@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-linked-issue do-not-merge/needs-tests-checked labels Dec 15, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Dec 18, 2023

/retest

Copy link

tiprow bot commented Dec 18, 2023

@ywqzzy: 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.

@tangenta tangenta self-requested a review December 18, 2023 06:47
br/pkg/lightning/backend/external/merge_v2.go Outdated Show resolved Hide resolved
br/pkg/lightning/backend/external/merge_v2.go Outdated Show resolved Hide resolved
br/pkg/lightning/backend/external/merge_v2.go Outdated Show resolved Hide resolved
@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 Dec 18, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Dec 18, 2023

ut failed since i changed the error checking, will fix it later

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Dec 19, 2023

/retest

Copy link

tiprow bot commented Dec 19, 2023

@ywqzzy: 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.

@ywqzzy ywqzzy requested review from lance6716 and D3Hunter December 19, 2023 02:40
@D3Hunter
Copy link
Contributor

/lgtm

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

@Benjamin2037 Benjamin2037 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 Dec 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, D3Hunter

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 Dec 19, 2023
Copy link

ti-chi-bot bot commented Dec 19, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-19 06:05:55.047724163 +0000 UTC m=+941046.084951091: ☑️ agreed by D3Hunter.
  • 2023-12-19 07:35:45.234119016 +0000 UTC m=+946436.271345941: ☑️ agreed by Benjamin2037.

@ti-chi-bot ti-chi-bot bot merged commit 971b611 into pingcap:master Dec 19, 2023
18 of 20 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.

4 participants