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: support pre-split index regions before creating index #57553

Merged
merged 17 commits into from
Dec 18, 2024

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Nov 20, 2024

What problem does this PR solve?

Issue Number: close #57552, close #57551

Problem Summary:

See #57552.

What changed and how does it work?

  • Support specifying the split option in the index option at parser.
  • Split the target index region by keys or ranges before data reorganization when adding an index.
  • Extract common code and tests from pkg/executor/split.go to pkg/util/split.go.
  • Add two functional tests.

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/invalid-title do-not-merge/needs-tests-checked 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 Nov 20, 2024
Copy link

tiprow bot commented Nov 20, 2024

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

@tangenta tangenta changed the title Support pre-split index regions before creating index ddl: support pre-split index regions before creating index Nov 20, 2024
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 25.18519% with 303 lines in your changes missing coverage. Please review.

Project coverage is 74.9483%. Comparing base (4ec2b23) to head (d86e2ef).
Report is 123 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57553        +/-   ##
================================================
+ Coverage   73.1893%   74.9483%   +1.7589%     
================================================
  Files          1675       1722        +47     
  Lines        461929     471007      +9078     
================================================
+ Hits         338083     353012     +14929     
+ Misses       103081      95784      -7297     
- Partials      20765      22211      +1446     
Flag Coverage Δ
integration 49.1991% <17.0940%> (?)
unit 72.2659% <25.1851%> (-0.0525%) ⬇️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 61.7405% <ø> (+15.7437%) ⬆️

pkg/parser/parser.y Outdated Show resolved Hide resolved
pkg/parser/ast/ddl.go Outdated Show resolved Hide resolved
pkg/parser/ast/ddl.go Outdated Show resolved Hide resolved
pkg/meta/model/job_args.go Show resolved Hide resolved
pkg/ddl/index.go Outdated Show resolved Hide resolved
pkg/meta/model/job_args.go Show resolved Hide resolved
pkg/ddl/index_presplit.go Outdated Show resolved Hide resolved
pkg/ddl/index_presplit.go Outdated Show resolved Hide resolved
pkg/ddl/index_presplit.go Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 25, 2024
pkg/ddl/index_presplit.go Outdated Show resolved Hide resolved
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

if err != nil {
return errors.Trace(err)
}
splitOnTempIdx := reorgMeta.ReorgTp == model.ReorgTypeLitMerge ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the txnMerge method still used? I thought you have disable this path already.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 13, 2024
Copy link

ti-chi-bot bot commented Dec 13, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-25 08:21:19.905921193 +0000 UTC m=+451867.525575708: ☑️ agreed by D3Hunter.
  • 2024-12-13 07:15:31.46834041 +0000 UTC m=+595521.557142953: ☑️ agreed by Benjamin2037.

Copy link

ti-chi-bot bot commented Dec 18, 2024

@Frank945946: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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.

@tangenta
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Dec 18, 2024

@tangenta: 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-sigs/prow repository.

@tangenta
Copy link
Contributor Author

/lgtm

Copy link

ti-chi-bot bot commented Dec 18, 2024

@tangenta: you cannot LGTM your own PR.

In response to this:

/lgtm

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.

@ti-chi-bot ti-chi-bot bot added the approved label Dec 18, 2024
Copy link

ti-chi-bot bot commented Dec 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, benmeadowcroft, D3Hunter, Frank945946, tangenta, yudongusa

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 merged commit 177a03c into pingcap:master Dec 18, 2024
26 checks passed
@tangenta tangenta added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Dec 26, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #58541.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 26, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
tangenta added a commit to tangenta/tidb that referenced this pull request Jan 7, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>

resolve conflict

update bazel

update bazel
tangenta pushed a commit to tangenta/tidb that referenced this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. 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.

Support pre-split index regions before creating index Cluster suffering write hotspot after creating index
9 participants