Skip to content

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #22296

What is changed, added or deleted? (Required)

ref tikv/tikv#18994

Update documentation for storage.flow-control.l0-files-threshold and storage.flow-control.soft-pending-compaction-bytes-limit to reflect the behavior change introduced in TiKV PR #18994.

  • v8.5.4 and earlier: flow-control config unconditionally overrides the corresponding RocksDB config.
  • From v8.5.5: flow-control config only overrides when it is smaller than the RocksDB config, to avoid weakening RocksDB's compaction acceleration mechanism when increasing flow-control thresholds.

Also update the corresponding RocksDB config items (level0-slowdown-writes-trigger, soft-pending-compaction-bytes-limit) with the same version-specific behavior notes.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • 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)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

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

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

@ti-chi-bot ti-chi-bot added area/engine Indicates that the Issue or PR belongs to the area of TP storage or Cloud storage. lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. ok-to-test Indicates a PR is ready to be tested. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. labels Jan 13, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ti-chi-bot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the TiKV configuration documentation to accurately describe the revised interaction between TiKV's flow control parameters and RocksDB's internal compaction thresholds. It clarifies a critical behavior change introduced in TiKV v8.5.5, where flow control settings now conditionally override RocksDB settings to prevent unintended performance degradation.

Highlights

  • Updated Flow Control Override Logic: The documentation now reflects a significant change in how TiKV's flow control configurations (l0-files-threshold, soft-pending-compaction-bytes-limit) interact with and override corresponding RocksDB settings.
  • Version-Specific Behavior: For TiKV versions v8.5.4 and earlier, flow control settings unconditionally overrode RocksDB settings. From v8.5.5 onwards, the override only occurs if the flow control value is smaller than the corresponding RocksDB value.
  • Performance Preservation: This new conditional override mechanism is designed to prevent weakening RocksDB's compaction acceleration mechanism, especially when flow control thresholds are increased.
  • RocksDB Configuration Updates: The documentation for related RocksDB configuration items (level0-slowdown-writes-trigger, soft-pending-compaction-bytes-limit) has also been updated to detail this version-specific override behavior.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 13, 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 lance6716 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

Copy link
Contributor

@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 updates the documentation for storage.flow-control.l0-files-threshold and storage.flow-control.soft-pending-compaction-bytes-limit to reflect a behavior change starting from TiKV v8.5.5. The changes correctly centralize the detailed override logic in the corresponding RocksDB configuration sections and add version-specific notes. My review focuses on improving the clarity of the new explanations. I've provided two suggestions to rephrase sentences that could be confusing, making the behavior easier to understand for users.

+ The maximum number of files at L0 that trigger write stall. When `storage.flow-control.enable` is set to `true`, `storage.flow-control.l0-files-threshold` overrides this configuration item.
+ The maximum number of files at L0 that trigger write stall.
+ In v8.5.4 and earlier versions: when the flow control mechanism is enabled ([`storage.flow-control.enable`](/tikv-configuration-file.md#enable) is `true`), the value of this configuration item is directly overridden by [`storage.flow-control.l0-files-threshold`](/tikv-configuration-file.md#l0-files-threshold).
+ Starting from v8.5.5 and v9.0.0: when the flow control mechanism is enabled ([`storage.flow-control.enable`](/tikv-configuration-file.md#enable) is `true`), the value of this configuration item is overridden by [`storage.flow-control.l0-files-threshold`](/tikv-configuration-file.md#l0-files-threshold) only when its value is greater than `storage.flow-control.l0-files-threshold`. This behavior prevents weakening RocksDB's compaction acceleration mechanism when you increase the flow control threshold.
Copy link
Contributor

Choose a reason for hiding this comment

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

low

To improve clarity, I suggest rephrasing this sentence to explain what the effective value will be. This avoids a potentially confusing self-reference and makes the behavior easier for users to understand.

Suggested change
+ Starting from v8.5.5 and v9.0.0: when the flow control mechanism is enabled ([`storage.flow-control.enable`](/tikv-configuration-file.md#enable) is `true`), the value of this configuration item is overridden by [`storage.flow-control.l0-files-threshold`](/tikv-configuration-file.md#l0-files-threshold) only when its value is greater than `storage.flow-control.l0-files-threshold`. This behavior prevents weakening RocksDB's compaction acceleration mechanism when you increase the flow control threshold.
+ Starting from v8.5.5 and v9.0.0: when the flow control mechanism is enabled ([`storage.flow-control.enable`](/tikv-configuration-file.md#enable) is `true`), the effective threshold for write stall is the smaller value between this configuration item and [`storage.flow-control.l0-files-threshold`](/tikv-configuration-file.md#l0-files-threshold). This behavior prevents weakening RocksDB's compaction acceleration mechanism when you increase the flow control threshold.
References
  1. The documentation should be clear, simple, and easy for users to understand. If something might be confusing, it should be reworded. (link)

+ The soft limit on the pending compaction bytes. When `storage.flow-control.enable` is set to `true`, `storage.flow-control.soft-pending-compaction-bytes-limit` overrides this configuration item.
+ The soft limit on the pending compaction bytes.
+ In v8.5.4 and earlier versions: when the flow control mechanism is enabled ([`storage.flow-control.enable`](/tikv-configuration-file.md#enable) is `true`), this configuration item is directly overridden by [`storage.flow-control.soft-pending-compaction-bytes-limit`](/tikv-configuration-file.md#soft-pending-compaction-bytes-limit).
+ Starting from v8.5.5 and v9.0.0: when the flow control mechanism is enabled ([`storage.flow-control.enable`](/tikv-configuration-file.md#enable) is `true`), this configuration item is overridden by [`storage.flow-control.soft-pending-compaction-bytes-limit`](/tikv-configuration-file.md#soft-pending-compaction-bytes-limit) only when its value is greater than `storage.flow-control.soft-pending-compaction-bytes-limit`. This behavior prevents weakening RocksDB's compaction acceleration mechanism when you increase the flow control threshold.
Copy link
Contributor

Choose a reason for hiding this comment

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

low

To improve clarity, especially since the two parameter names are very similar, I suggest rephrasing this sentence to explain what the effective value will be. This avoids a potentially confusing self-reference and makes the behavior easier for users to understand.

Suggested change
+ Starting from v8.5.5 and v9.0.0: when the flow control mechanism is enabled ([`storage.flow-control.enable`](/tikv-configuration-file.md#enable) is `true`), this configuration item is overridden by [`storage.flow-control.soft-pending-compaction-bytes-limit`](/tikv-configuration-file.md#soft-pending-compaction-bytes-limit) only when its value is greater than `storage.flow-control.soft-pending-compaction-bytes-limit`. This behavior prevents weakening RocksDB's compaction acceleration mechanism when you increase the flow control threshold.
+ Starting from v8.5.5 and v9.0.0: when the flow control mechanism is enabled ([`storage.flow-control.enable`](/tikv-configuration-file.md#enable) is `true`), the effective soft limit for pending compaction bytes is the smaller value between this configuration item and [`storage.flow-control.soft-pending-compaction-bytes-limit`](/tikv-configuration-file.md#soft-pending-compaction-bytes-limit). This behavior prevents weakening RocksDB's compaction acceleration mechanism when you increase the flow control threshold.
References
  1. The documentation should be clear, simple, and easy for users to understand. If something might be confusing, it should be reworded. (link)

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

Labels

area/engine Indicates that the Issue or PR belongs to the area of TP storage or Cloud storage. lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. ok-to-test Indicates a PR is ready to be tested. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants