You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify which hotspot scheduling paths honor replica placement constraints.
Clarify how to configure location-labels and isolation-level with Placement Rules enabled or disabled to preserve host-level isolation.
Add guidance that hot leader transfer does not repair an existing non-isolated replica layout by itself.
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
Other reference link(s): Ask Docs feedback about hotspot scheduling and host isolation.
AI agent involvement
The changes in this PR were primarily made by an AI agent on behalf of the PR author.
Do your changes match any of the following descriptions?
Delete files
Change aliases
Need modification after applied to another branch
Might cause conflicts after applied to another branch
Summary by CodeRabbit
Documentation
Clarified how hot-region leader migrations and transfers to existing voters affect replica placement and interact with Placement Rules, location labels, and isolation settings.
Added host-level isolation configuration guidance for Placement Rules disabled, default-rule, and custom-rule setups, including topology-label requirements and rule-specific settings.
Documented that hot-region migrations can still colocate replicas on one host, and that location replacement does not prevent this for hot-read migrations.
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign tangenta 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:
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The documentation adds host-level replica-isolation setup guidance and describes how hot-region scheduling handles placement constraints with Placement Rules enabled or disabled.
The guidance covers host labels, voter replica distribution, and isolation settings for disabled Placement Rules, the default rule, and custom rules. It explains that custom rules use their own isolation settings and that label_constraints can restrict rules to non-overlapping hosts.
The guidance describes how hot-read and hot-write leader migrations consider placement constraints. It notes that transferring leadership to an existing voter does not change replica placement and that hot-region migration can still place replicas on the same host.
The documentation clarifies host-level replica isolation, but some open gaps could lead operators to a layout that is not host-isolated. These are low-risk documentation fixes that can be addressed before or shortly after merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title 'Clarify hotspot scheduling isolation behavior' matches the main change: the documentation now explains which hotspot scheduling paths honor location-labels and isolation-level, and how to c…
Description check
The description fills the template's required sections: the changed items are listed, the affected versions are checked (master and v8.5), the translation source is linked, and the AI agent involvemen…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title 'Clarify hotspot scheduling isolation behavior' matches the main change: the documentation now explains which hotspot scheduling paths honor location-labels and isolation-level, and how to configure them for host-level isolation. It is concise and specific, though it does not mention the host-level configuration guidance.
Full details: Description check
Explanation
The description fills the template's required sections: the changed items are listed, the affected versions are checked (master and v8.5), the translation source is linked, and the AI agent involvement field is marked. The Contributor License Agreement checkbox is absent from the author's copy, but it is only required for first-time contributors, so the description is mostly complete.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between b1001cb and e0fb919.
Files selected for processing: 2
best-practices/pd-scheduling-best-practices.md
configure-placement-rules.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
In response to a cherrypick label: only pingcap org members may request cherry picks. If you are already part of the org, make sure to change your membership to public. Otherwise you can still do the cherry-pick manually.
Line 94 says these settings let PD replace peers to improve isolation. That applies to the replica checker. Readers can still assume that the same settings protect hot-read leader moves. With Placement Rules disabled, move-hot-read-leader does not check location-labels or isolation-level, so these settings do not prevent it from reducing host isolation. Add a short clarification to the bullet.
Proposed change
-> - If Placement Rules are disabled, set `replication.location-labels` to include `host`, set `replication.isolation-level` to `host`, and keep `schedule.enable-location-replacement` enabled so PD can replace peers to improve isolation.
+> - If Placement Rules are disabled, set `replication.location-labels` to include `host`, set `replication.isolation-level` to `host`, and keep `schedule.enable-location-replacement` enabled so PD can replace peers to improve isolation. These settings do not prevent a hot-read leader move from reducing replica isolation.
Additional comments: 1
configure-placement-rules.md-112-112: 1
112-112: Major · Stability & Availability · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Specify how host labels identify a physical host.
If two TiKV stores on the same host have different host label values, PD can treat them as separate locations and place replicas on both. State that stores on the same host must use the same topology labels through the host level. Also state that different hosts must have distinct host identities within their parent topology.
Reviewing files that changed from the base of the PR and between aff3f03 and 5677888.
Files selected for processing: 2
best-practices/pd-scheduling-best-practices.md
configure-placement-rules.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
> - When Placement Rules are enabled and multiple rules exist, the previously configured `max-replicas`, `location-labels`, and `isolation-level` no longer take effect. To adjust the replica policy, use the interface related to Placement Rules.
> - When Placement Rules are enabled and only one default rule exists, TiDB will automatically update this default rule when `max-replicas`, `location-labels`, or `isolation-level` configurations are changed.
> - To require host-level replica isolation when Placement Rules are enabled, configure a `host` label on every TiKV store. Then either keep only the default rule and set `replication.location-labels` to include `host` plus `replication.isolation-level = "host"`, or set `location_labels` and `isolation_level` explicitly in each relevant placement rule. Cluster-level replication settings do not override custom rules.
The reason will be displayed to describe this comment to others. Learn more.
Major · Stability & Availability · Heavy lift
Do not promise cross-rule host isolation.
A leader rule and a follower rule can each have count = 1 and host isolation configured. PD scores isolation among the peers assigned to each rule, so replicas assigned to different rules can still share a host. A host failure can then affect both replicas. Clarify this limitation and describe how to constrain the rules to disjoint host sets, or use one rule for the replicas that must be isolated. (raw.githubusercontent.com)
Minor · Functional Correctness · Quick win
Specify the host values in custom rules.
The custom-rule instruction does not state the values that require host isolation. The example in the same section sets isolation_level to an empty string, which does not require isolation. A reader who follows that pattern can end up without host-level replica isolation. State that location_labels must include host and isolation_level must be "host", as the default-rule path does.
Suggested wording
--- "a/configure-placement-rules.md"+++ "b/configure-placement-rules.md"@@ -109,7 +109,7 @@
>
> - When Placement Rules are enabled and multiple rules exist, the previously configured `max-replicas`, `location-labels`, and `isolation-level` no longer take effect. To adjust the replica policy, use the interface related to Placement Rules.
> - When Placement Rules are enabled and only one default rule exists, TiDB will automatically update this default rule when `max-replicas`, `location-labels`, or `isolation-level` configurations are changed.
-> - To require host-level replica isolation when Placement Rules are enabled, configure a `host` label on every TiKV store. Then either keep only the default rule and set `replication.location-labels` to include `host` plus `replication.isolation-level = "host"`, or set `location_labels` and `isolation_level` explicitly in each relevant placement rule. Cluster-level replication settings do not override custom rules.+> - To require host-level replica isolation when Placement Rules are enabled, configure a `host` label on every TiKV store. Then either keep only the default rule and set `replication.location-labels` to include `host` plus `replication.isolation-level = "host"`, or set `location_labels` to include `host` and `isolation_level` to `"host"` explicitly in each relevant placement rule. Cluster-level replication settings do not override custom rules.
### Disable Placement Rules
Committable suggestion
IMPORTANT
Review the replacement and indentation, then test before committing.
Suggested change
> - To require host-level replica isolation when Placement Rules are enabled, configure a `host` label on every TiKV store. Then either keep only the default rule and set `replication.location-labels` to include `host` plus `replication.isolation-level = "host"`, or set `location_labels` and `isolation_level` explicitly in each relevant placement rule. Cluster-level replication settings do not override custom rules.
> - To require host-level replica isolation when Placement Rules are enabled, configure a `host` label on every TiKV store. Then either keep only the default rule and set `replication.location-labels` to include `host` plus `replication.isolation-level = "host"`, or set `location_labels`to include `host`and `isolation_level` to `"host"` explicitly in each relevant placement rule. Cluster-level replication settings do not override custom rules.
ti-chi-botBot
added
size/M
Denotes a PR that changes 30-99 lines, ignoring generated files.
and removed
size/S
Denotes a PR that changes 10-29 lines, ignoring generated files.
labels
Dec 3, 2026
Reviewing files that changed from the base of the PR and between 5677888 and b1001cb.
Files selected for processing: 2
best-practices/pd-scheduling-best-practices.md
configure-placement-rules.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
If you only need host isolation and do not need replicas distributed across zones or racks, configure the cluster as follows so that leader and peer migrations for hot regions keep voter replicas on different hosts:
1. Configure an accurate `host` label for every store, make sure the number of available hosts is at least the number of voter replicas, and confirm that existing voter replicas are already distributed across different hosts.
2. Enable Placement Rules so that all voter replicas of the same Region are managed by the same `voter` rule.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Explain how to obtain the single voter rule.
If a cluster has retained multiple rules, enabling Placement Rules restores those rules; it does not consolidate them into one voter rule. Step 3 then has no single rule to configure. Direct readers to inspect and, if necessary, adjust the matching rules before continuing, while preserving the warning about existing policies.
As per coding guidelines, procedural steps must “make each step a clear action.”
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Add the location-replacement prerequisite to the disabled-rules procedure.
If Placement Rules are disabled and some replicas of a Region are on the same host, the labels and isolation level in this procedure do not move those replicas. PD does not increase a replica's isolation through scheduling while schedule.enable-location-replacement is false (pd-control.md). Enable this setting before you apply the procedure to an existing cluster. Then confirm that the replicas are on different hosts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area/schedulingIndicates that the Issue or PR belongs to the area of scheduling.contributionThis PR is from a community contributor.needs-cherry-pick-release-8.5Should cherry pick this PR to release-8.5 branch.ONCALLRelates to documentation oncall.size/MDenotes a PR that changes 30-99 lines, ignoring generated files.translation/from-docs-cnThis PR is translated from a PR in pingcap/docs-cn.type/bugfixThis PR fixes a bug.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is changed, added, or deleted? (Required)
location-labelsandisolation-levelwith Placement Rules enabled or disabled to preserve host-level isolation.Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?
Summary by CodeRabbit