Skip to content

add-index: use max-node-count as hint when split subtasks on nextgen#63861

Merged
ti-chi-bot[bot] merged 3 commits into
pingcap:masterfrom
D3Hunter:fix-nodecount-addindex
Oct 9, 2025
Merged

add-index: use max-node-count as hint when split subtasks on nextgen#63861
ti-chi-bot[bot] merged 3 commits into
pingcap:masterfrom
D3Hunter:fix-nodecount-addindex

Conversation

@D3Hunter

@D3Hunter D3Hunter commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: ref #61702

Problem Summary:

What changed and how does it work?

as title, as in nextgen, node resource are scaled out automatically

Check List

Tests

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

before this PR, we only have 1 node currently, and only split 1 subtask, even if the max-node-count is 12

["initialize reorg meta"] [keyspaceName=10915712792865637958] [category=ddl] [jobID=0] [jobSchema=test] [jobTable=test_01] [jobType="add index"] [enableDistTask=true] [enableFastReorg=true] [targetScope=dxf_service] [maxNodeCount=12] [tableSizeInBytes=698.1GiB] [concurrency=7] [batchSize=256] [amplifyFactor=3]

["calculate region batch"] [keyspaceName=SYSTEM] [category=ddl] [type=backfill] [task-id=450004] [curr-step=init] [next-step=read-index] [totalRegionCnt=2001] [regionBatch=2001] [instanceCnt=1] [useCloud=true]
["schedule subtasks"] [keyspaceName=SYSTEM] [task-id=450004] [task-key=10915712792865637958/ddl/backfill/20] [state=pending] [step=read-index] [concurrency=7] [subtasks=1]

after this PR, we mock max-node to be 10, 2 subtasks are splitted, as we only have 2 regions on local environment

["calculate region batch"] [keyspaceName=SYSTEM] [category=ddl] [type=backfill] [task-id=6] [node-count=10] [curr-step=init] [next-step=read-index] [totalRegionCnt=2] [regionBatch=1] [instanceCnt=10] [useCloud=false]
["schedule subtasks"] [keyspaceName=SYSTEM] [task-id=6] [task-key=SYSTEM/ddl/backfill/17] [state=pending] [step=read-index] [concurrency=1] [subtasks=2]
  • 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 9, 2025
@tiprow

tiprow Bot commented Oct 9, 2025

Copy link
Copy Markdown

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.

Details

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.

Comment thread pkg/ddl/backfilling_dist_scheduler.go Outdated
// in nextgen, node resource are scaled out automatically, we only consider
// the max allowed node for the task, and ignore how many node currently
// available.
nodeCnt = task.MaxNodeCount

@tangenta tangenta Oct 9, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it is safer to use max(task.MaxNodeCount, 1) in case of task.MaxNodeCount == 0

Image

@codecov

codecov Bot commented Oct 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.9228%. Comparing base (c350a7d) to head (34d7da2).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #63861        +/-   ##
================================================
+ Coverage   72.7354%   74.9228%   +2.1874%     
================================================
  Files          1849       1896        +47     
  Lines        499590     507801      +8211     
================================================
+ Hits         363379     380459     +17080     
+ Misses       114126     103879     -10247     
- Partials      22085      23463      +1378     
Flag Coverage Δ
integration 48.2936% <0.0000%> (?)
unit 72.5168% <100.0000%> (+0.2404%) ⬆️

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

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 63.2687% <ø> (+16.8553%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ti-chi-bot ti-chi-bot Bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 9, 2025
@ti-chi-bot

ti-chi-bot Bot commented Oct 9, 2025

Copy link
Copy Markdown

[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

Details 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 Oct 9, 2025
@ti-chi-bot

ti-chi-bot Bot commented Oct 9, 2025

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2025-10-09 04:50:06.381802322 +0000 UTC m=+329395.412901640: ☑️ agreed by tangenta.
  • 2025-10-09 04:53:21.154254179 +0000 UTC m=+329590.185353507: ☑️ agreed by wjhuang2016.

@D3Hunter

D3Hunter commented Oct 9, 2025

Copy link
Copy Markdown
Contributor Author

/retest

@tiprow

tiprow Bot commented Oct 9, 2025

Copy link
Copy Markdown

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

Details

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.

@ti-chi-bot ti-chi-bot Bot merged commit 8ddebe9 into pingcap:master Oct 9, 2025
32 checks passed
@D3Hunter D3Hunter deleted the fix-nodecount-addindex branch October 9, 2025 12:13
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants