Skip to content

docs: clarify Raft leader lease timing#23287

Open
wenxiaojie1 wants to merge 4 commits into
pingcap:masterfrom
wenxiaojie1:docs/clarify-raft-timing-constraint
Open

docs: clarify Raft leader lease timing#23287
wenxiaojie1 wants to merge 4 commits into
pingcap:masterfrom
wenxiaojie1:docs/clarify-raft-timing-constraint

Conversation

@wenxiaojie1

@wenxiaojie1 wenxiaojie1 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What is changed, added or deleted? (Required)

Document the startup constraint for raft-store-max-leader-lease: its value must leave one raft-base-tick-interval before the Raft election timeout. This reflects the TiKV configuration validation and helps prevent invalid timing configurations from causing startup failures.

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.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)

What is the related PR or file link(s)?

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
    • Added a startup configuration constraint for raft-store-max-leader-lease.
    • TiKV will not start successfully if this value exceeds the permitted election timeout threshold.

@ti-chi-bot ti-chi-bot Bot added contribution This PR is from a community contributor. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Jul 15, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

Hi @wenxiaojie1. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 15, 2026

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

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.

Code Review

This pull request updates the tikv-configuration-file.md documentation to add a constraint for the raft-store-max-leader-lease configuration option. The review feedback suggests rewriting the added sentence in the second person ("you") to align with the repository style guide and removing unnecessary backticks around the numeric literal 1.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tikv-configuration-file.md Outdated
### `raft-store-max-leader-lease`

+ The longest trusted period of a Raft leader
+ To start TiKV successfully, set this value to no more than `raft-base-tick-interval` * (`raft-election-timeout-ticks` - `1`).

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.

low

According to the repository style guide, we should write in the second person ("you") when addressing users. Additionally, the number 1 in the formula does not need to be in backticks as it is a numeric literal rather than a configuration option or command.

Suggested change
+ To start TiKV successfully, set this value to no more than `raft-base-tick-interval` * (`raft-election-timeout-ticks` - `1`).
+ To start TiKV successfully, you must set this value to no more than `raft-base-tick-interval` * (`raft-election-timeout-ticks` - 1).
References
  1. Write in second person ("you") when addressing users. (link)

@qiancai

qiancai commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

/cc @pingyu

@ti-chi-bot
ti-chi-bot Bot requested a review from pingyu July 17, 2026 07:40
@qiancai qiancai self-assigned this Jul 17, 2026
@qiancai qiancai added translation/doing This PR's assignee is translating this PR. and removed missing-translation-status This PR does not have translation status info. labels Jul 17, 2026
Comment thread tikv-configuration-file.md Outdated
Co-authored-by: Ping Yu <shui.yu@126.com>
@ti-chi-bot

ti-chi-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

[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 ask for approval from qiancai. 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

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 25, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-07-25 07:33:58.788916388 +0000 UTC m=+1649424.825011434: ☑️ agreed by qiancai.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@qiancai, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0a8876cc-50fe-4db1-bbb1-ede41952c77f

📥 Commits

Reviewing files that changed from the base of the PR and between 2da195b and 6b22406.

📒 Files selected for processing (1)
  • tikv-configuration-file.md
📝 Walkthrough

Walkthrough

The TiKV configuration documentation adds a startup constraint for raft-store-max-leader-lease, defining its maximum value from raft-base-tick-interval and raft-election-timeout-ticks.

Changes

TiKV configuration documentation

Layer / File(s) Summary
Document leader lease startup constraint
tikv-configuration-file.md
Documents the upper bound required for raft-store-max-leader-lease for TiKV startup to succeed.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: qiancai, mittalrishabh

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the documentation update about Raft leader lease timing.
Description check ✅ Passed The description includes the required change summary, affected version, related links, and AI involvement sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

Comment thread tikv-configuration-file.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. translation/doing This PR's assignee is translating this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants