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: fix broken prop with onefile writer #49589

Merged
merged 11 commits into from
Dec 20, 2023

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Dec 19, 2023

What problem does this PR solve?

Issue Number: close #49590

Problem Summary:

What changed and how does it work?

When exceed writer memlimit, create new prop with kv.offset.

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 19, 2023
Copy link

tiprow bot commented Dec 19, 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 19, 2023

Codecov Report

Merging #49589 (a5238bc) into master (27aed31) will increase coverage by 0.6395%.
Report is 2 commits behind head on master.
The diff coverage is 0.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #49589        +/-   ##
================================================
+ Coverage   71.0024%   71.6419%   +0.6395%     
================================================
  Files          1368       1423        +55     
  Lines        399178     418371     +19193     
================================================
+ Hits         283426     299729     +16303     
- Misses        95967      99912      +3945     
+ Partials      19785      18730      -1055     
Flag Coverage Δ
integration 44.3160% <0.0000%> (?)
unit 71.0028% <ø> (+0.0004%) ⬆️

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

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

@@ -148,7 +148,7 @@ func TestGlobalSortLocalWithMerge(t *testing.T) {
startKey = BytesMin(startKey, s.Min.Clone())
endKey = BytesMax(endKey, s.Max.Clone().Next())
}

mergeMemSize := (rand.Intn(10) + 1) * 100
Copy link
Collaborator

@Benjamin2037 Benjamin2037 Dec 20, 2023

Choose a reason for hiding this comment

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

what does this “mergeMemSize := (rand.Intn(10) + 1) * 100” mean, why here use a random func?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make the test run more cases to check different memSize/blockSize of writer can be used for writer.
When memSize is small enough, we will reach line 109 in onefile writer, hopefully the bug will reproduce.

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

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 20, 2023
@@ -761,6 +763,7 @@ var (
concurrency = flag.Int("concurrency", 100, "concurrency")
memoryLimit = flag.Int("memory-limit", 64*units.MiB, "memory limit")
skipCreate = flag.Bool("skip-create", false, "skip create files")
fileName = flag.String("file-name", "test", "test")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, I will rename it

Copy link

ti-chi-bot bot commented Dec 20, 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 20, 2023
Copy link

ti-chi-bot bot commented Dec 20, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-20 02:05:47.279500414 +0000 UTC m=+1013038.316727348: ☑️ agreed by Benjamin2037.
  • 2023-12-20 02:27:47.749665382 +0000 UTC m=+1014358.786892308: ☑️ agreed by D3Hunter.

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Dec 20, 2023

/retest

Copy link

tiprow bot commented Dec 20, 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.

@hawkingrei
Copy link
Member

/retest

1 similar comment
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Dec 20, 2023

/retest

Copy link

tiprow bot commented Dec 20, 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
Copy link
Contributor Author

ywqzzy commented Dec 20, 2023

/retest

Copy link

tiprow bot commented Dec 20, 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.

@ti-chi-bot ti-chi-bot bot merged commit da460f1 into pingcap:master Dec 20, 2023
17 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

global sort read wrong offset when read stat file of onefile writer
4 participants