Skip to content

server: honor scheduler concurrency for coordinator#4832

Draft
wlwilliamx wants to merge 1 commit intopingcap:masterfrom
wlwilliamx:codex/create-cf-oom-optimization-20260415
Draft

server: honor scheduler concurrency for coordinator#4832
wlwilliamx wants to merge 1 commit intopingcap:masterfrom
wlwilliamx:codex/create-cf-oom-optimization-20260415

Conversation

@wlwilliamx
Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #4831

What is changed and how it works?

The coordinator was constructed with hard-coded scheduling settings:

  • max task concurrency: 10000
  • balance interval: time.Minute

This bypassed Debug.Scheduler.MaxTaskConcurrency and Debug.Scheduler.CheckBalanceInterval. During bulk changefeed creation, the basic scheduler could therefore schedule a very large number of absent changefeeds at once, causing many maintainer bootstraps to run concurrently.

This PR reads the coordinator scheduler settings from the validated global server config before constructing the coordinator. With the default config, maintainer scheduling concurrency returns to 10, which reduces creation-time memory and CPU spikes by throttling concurrent bootstrap work.

Check List

Tests

  • Unit test
  • Manual test
go test ./server

Questions

Will it cause performance regression or break compatibility?

It should reduce CPU and memory spikes during bulk changefeed creation by honoring the existing scheduler concurrency config. It may make very large bulk creation finish more gradually compared with the previous hard-coded 10000 concurrency, but that behavior matches the intended configurable scheduler limit and can be tuned via server config.

Do you need to update user documentation, design documentation or monitoring documentation?

No. This PR makes existing scheduler config effective for coordinator scheduling.

Release note

Fix TiCDC coordinator to honor scheduler max task concurrency when scheduling changefeed maintainers.

Use the validated server scheduler config when constructing the coordinator so maintainer scheduling concurrency respects max-task-concurrency instead of a hard-coded value.
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 15, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Apr 15, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hongyunyan for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8144d17c-9f2f-453c-b59f-318e4744432c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot ti-chi-bot Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 15, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces hardcoded values for coordinator task concurrency and balance interval with dynamic settings retrieved from the global server configuration. It introduces a helper function coordinatorSchedulerSettings and includes a corresponding unit test to ensure the configuration is correctly applied. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TiCDC can spike memory and CPU when bulk-creating idle changefeeds

1 participant