server: honor scheduler concurrency for coordinator#4832
server: honor scheduler concurrency for coordinator#4832wlwilliamx wants to merge 1 commit intopingcap:masterfrom
Conversation
Use the validated server scheduler config when constructing the coordinator so maintainer scheduling concurrency respects max-task-concurrency instead of a hard-coded value.
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.
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:
10000time.MinuteThis bypassed
Debug.Scheduler.MaxTaskConcurrencyandDebug.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
go test ./serverQuestions
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
10000concurrency, 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