-
Notifications
You must be signed in to change notification settings - Fork 124
zh,en: add feature gates doc #3026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ti-chi-bot
merged 10 commits into
pingcap:main
from
liubog2008:liubo02/add-feature-gates
Dec 3, 2025
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6306999
zh,en: add feature gates doc
liubog2008 64df287
Apply suggestions from code review
liubog2008 e184b89
fix lint and address comments
liubog2008 abbbf2e
Apply suggestions from code review
liubog2008 b5f33bd
Apply suggestions from code review
liubog2008 472f963
Apply suggestion from @Oreoxmt
liubog2008 632d25b
make ci happy
Oreoxmt 521e7a6
update English doc
Oreoxmt 9fb0ea9
Apply suggestions from code review
Oreoxmt 9c762ee
Apply suggestions from code review
Oreoxmt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
| title: Feature Gates | ||
| summary: Learn how to use feature gates to enable or disable specific features in a TiDB cluster. | ||
| --- | ||
|
|
||
| # Feature Gates | ||
|
|
||
| Feature gates are configuration switches that enable or disable specific features in TiDB Operator. These features are typically experimental, and enabling them might require restarting certain cluster components. | ||
|
|
||
| You can configure feature gates in the `spec.featureGates` field of the Cluster Custom Resource (CR). The following example shows how to enable the `FeatureModification` feature gate: | ||
|
|
||
| ```yaml | ||
| spec: | ||
| featureGates: | ||
| FeatureModification: true | ||
| ``` | ||
|
|
||
| ## Supported feature gates | ||
|
|
||
| This section describes the feature gates supported by TiDB Operator. For the definition of feature stages, see [Feature gate stages](#feature-gate-stages). | ||
Oreoxmt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### `FeatureModification` | ||
|
|
||
| - When this feature is enabled, you can modify the `spec.featureGates` configuration. | ||
| - Default value: `false` | ||
| - Stage: Alpha in v2.0 and later versions | ||
| - Components requiring restart: None | ||
|
|
||
| ### `VolumeAttributesClass` | ||
|
|
||
| - When this feature is enabled, you can modify the `VolumeAttributesClass` attribute of a PVC. This feature depends on the corresponding Kubernetes capability. For more information, see the [Kubernetes documentation for VolumeAttributesClass](https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/). | ||
| - Default value: `false` | ||
| - Stage: Alpha in v2.0 and later versions | ||
| - Components requiring restart: None | ||
|
|
||
| ### `DisablePDDefaultReadinessProbe` | ||
|
|
||
| - When this feature is enabled, TiDB Operator no longer checks PD readiness using TCP probes. | ||
| - Default value: `false` | ||
| - Stage: Alpha in v2.0 and later versions | ||
| - Components requiring restart: PD | ||
|
|
||
| ### `UsePDReadyAPI` | ||
|
|
||
| - When this feature is enabled, TiDB Operator checks PD readiness using the `/ready` API. For implementation details, see [`tikv/pd` #8749](https://github.com/tikv/pd/pull/8749). | ||
| - Default value: `false` | ||
| - Stage: Alpha in v2.0 and later versions | ||
| - Components requiring restart: PD | ||
|
|
||
| ### `SessionTokenSigning` | ||
|
|
||
| - When this feature is enabled, TiDB Operator automatically configures the [`session-token-signing-cert`](https://docs.pingcap.com/tidb/stable/tidb-configuration-file/#session-token-signing-cert-new-in-v640) and [`session-token-signing-key`](https://docs.pingcap.com/tidb/stable/tidb-configuration-file/#session-token-signing-key-new-in-v640) parameters for TiDB. | ||
| - Default value: `false` | ||
| - Stage: Alpha in v2.0 and later versions | ||
| - Components requiring restart: TiDB | ||
|
|
||
| ## Feature gate stages | ||
|
|
||
| TiDB Operator classifies feature gates into three stages based on maturity: Alpha, Beta, and GA. | ||
Oreoxmt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Alpha | ||
|
|
||
| Alpha-stage features have the following characteristics: | ||
|
|
||
| - Disabled by default. | ||
| - Recommended for use only in newly created clusters. | ||
Oreoxmt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Dynamic enabling or disabling in existing clusters is not guaranteed. | ||
| - Known or unknown issues might occur after enabling. | ||
Oreoxmt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - **Not recommended for production environments** unless risks are fully evaluated and validated. | ||
|
|
||
| ### Beta | ||
|
|
||
| Beta-stage features have the following characteristics: | ||
|
|
||
| - Typically have undergone thorough testing. | ||
| - Recommended to enable in all newly created clusters. | ||
| - Usually support enabling or disabling on existing clusters, but might require restarting related components. | ||
Oreoxmt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### GA | ||
|
|
||
| GA (General Availability) features have the following characteristics: | ||
|
|
||
| - Typically have undergone long-term and large-scale testing. | ||
| - Enabled by default. | ||
| - Cannot be disabled. | ||
Oreoxmt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,85 @@ | ||||||
| --- | ||||||
| title: 特性门控 | ||||||
| summary: 介绍如何使用特性门控 (Feature Gates) 在 TiDB 集群中开启或关闭特定功能。 | ||||||
| --- | ||||||
|
|
||||||
| # 特性门控 | ||||||
|
|
||||||
| 特性门控 (Feature Gates) 是一组开关,用于控制 TiDB Operator 中特定功能的启用状态。这些功能通常处于实验阶段,启用后可能需要重启部分组件。 | ||||||
Oreoxmt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| 你可以在 Cluster CR 的 `spec.featureGates` 字段中配置特性门控。以下示例展示如何启用 `FeatureModification` 特性: | ||||||
|
|
||||||
| ```yaml | ||||||
| spec: | ||||||
| featureGates: | ||||||
| FeatureModification: true | ||||||
| ``` | ||||||
|
|
||||||
| ## 支持的特性门控 | ||||||
|
|
||||||
| 本节列出了 TiDB Operator 支持的特性门控。关于特性阶段的定义,请参考[特性门控阶段](#特性门控阶段)。 | ||||||
|
|
||||||
| ### `FeatureModification` | ||||||
|
|
||||||
| - 开启该特性后,你可以修改 `spec.featureGates` 配置。 | ||||||
| - 默认值:`false` | ||||||
| - 阶段:v2.0 及之后版本为 Alpha | ||||||
| - 需要重启的组件:无 | ||||||
|
|
||||||
| ### `VolumeAttributesClass` | ||||||
|
|
||||||
| - 开启该特性后,你可以修改 PVC 的 `VolumeAttributesClass` 属性。该功能依赖 Kubernetes 的对应能力。更多信息,请参考 [Kubernetes 官方文档 VolumeAttributesClass](https://kubernetes.io/zh-cn/docs/concepts/storage/volume-attributes-classes/)。 | ||||||
| - 默认值:`false` | ||||||
| - 阶段:v2.0 及之后版本为 Alpha | ||||||
| - 需要重启的组件:无 | ||||||
|
|
||||||
| ### `DisablePDDefaultReadinessProbe` | ||||||
|
|
||||||
| - 开启该特性后,TiDB Operator 不再通过 TCP 探测方式检查 PD 的就绪状态。 | ||||||
| - 默认值:`false` | ||||||
| - 阶段:v2.0 及之后版本为 Alpha | ||||||
| - 需要重启的组件:PD | ||||||
|
|
||||||
| ### `UsePDReadyAPI` | ||||||
|
|
||||||
| - 开启该特性后,TiDB Operator 将通过 PD 的 `/ready` API 检查就绪状态。有关实现细节,请参阅 [`tikv/pd` #8749](https://github.com/tikv/pd/pull/8749)。 | ||||||
| - 默认值:`false` | ||||||
| - 阶段:v2.0 及之后版本为 Alpha | ||||||
| - 需要重启的组件:PD | ||||||
|
|
||||||
| ### `SessionTokenSigning` | ||||||
|
|
||||||
| - 开启该特性后,TiDB Operator 会自动配置 TiDB 的 [`session-token-signing-cert`](https://docs.pingcap.com/zh/tidb/stable/tidb-configuration-file/#session-token-signing-cert-从-v640-版本开始引入) 和 [`session-token-signing-key`](https://docs.pingcap.com/zh/tidb/stable/tidb-configuration-file/#session-token-signing-key-从-v640-版本开始引入) 参数。 | ||||||
| - 默认值:`false` | ||||||
| - 阶段:v2.0 及之后版本为 Alpha | ||||||
| - 需要重启的组件:TiDB | ||||||
|
|
||||||
| ## 特性门控阶段 | ||||||
|
|
||||||
| 特性门控根据功能的成熟度分为 Alpha、Beta 和 GA 三个阶段。 | ||||||
|
|
||||||
| ### Alpha | ||||||
|
|
||||||
| Alpha 阶段的特性具有以下特点: | ||||||
|
|
||||||
| - 默认关闭。 | ||||||
| - 建议仅在新建集群中开启。 | ||||||
| - 不保证支持在已有集群中动态开启或关闭。 | ||||||
| - 开启后可能出现已知或未知问题。 | ||||||
| - **不建议在生产环境中使用**,除非已充分评估并验证风险。 | ||||||
|
|
||||||
| ### Beta | ||||||
|
|
||||||
| Beta 阶段的特性具有以下特点: | ||||||
|
|
||||||
| - 通常已经过较充分的测试。 | ||||||
| - 建议在所有新建集群中开启。 | ||||||
| - 通常支持在已有集群中开启或关闭,但可能需要重启相关组件。 | ||||||
|
|
||||||
| ### GA | ||||||
|
|
||||||
| GA (General Availability) 阶段的特性具有以下特点: | ||||||
|
|
||||||
| - 通常已经过长期和大规模测试。 | ||||||
| - 默认开启。 | ||||||
| - 不支持关闭。 | ||||||
|
||||||
| - 不支持关闭。 | |
| - 不支持通过特性门控关闭。 |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liubog2008 PTAL
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.
Uh oh!
There was an error while loading. Please reload this page.