Skip to content

Commit

Permalink
tikv config: hibernate region GA (#5789) (#5806)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jun 17, 2021
1 parent f373411 commit 1090e9b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion best-practices/massive-regions-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ By default, `raftstore.store-pool-size` is configured to `2` in TiKV. If a bottl

In the actual situation, read and write requests are not evenly distributed on every Region. Instead, they are concentrated on a few Regions. Then you can minimize the number of messages between the Raft leader and the followers for the temporarily idle Regions, which is the feature of Hibernate Region. In this feature, Raftstore does sent tick messages to the Raft state machines of idle Regions if not necessary. Then these Raft state machines will not be triggered to generate heartbeat messages, which can greatly reduce the workload of Raftstore.

Hibernate Region is enabled by default in [TiKV master](https://github.com/tikv/tikv/tree/master). You can enable this feature according to your needs. For the configuration of Hibernate Region, refer to [Configure Hibernate Region](/tikv-configuration-file.md#hibernate-regions-experimental).
Hibernate Region is enabled by default in [TiKV master](https://github.com/tikv/tikv/tree/master). You can configure this feature according to your needs. For details, refer to [Configure Hibernate Region](/tikv-configuration-file.md).

### Method 3: Enable `Region Merge`

Expand Down
1 change: 0 additions & 1 deletion experimental-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ This document introduces the experimental features of TiDB in different versions
+ Improve the stability of the optimizer's choice of indexes (Introduced in v5.0)
+ Extend the statistics feature by collecting the multi-column order dependency information.
+ Refactor the statistics module, including deleting the `TopN` value from `CMSKetch` and the histogram, and adding NDV information for histogram buckets of each table index.
+ [hibernate-regions](/tikv-configuration-file.md#hibernate-regions-experimental). A Region that idles for a long time is automatically set as hibernated. This reduces the extra overhead caused by heartbeat messages between the Raft leader and the followers for idle Regions.

## Scheduling

Expand Down
2 changes: 1 addition & 1 deletion system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified
- Possible values:
- `LEGACY`: Uses the old way of scanning, that is, disable Green GC.
- `PHYSICAL`: Uses the physical scanning method, that is, enable Green GC.
- This parameter specifies the way of scanning locks in the Resolve Locks step of GC. When set to `LEGACY`, TiDB scans locks by Regions. The value `PHYSICAL` enables each TiKV node to bypass the Raft layer and directly scan data. This feature can effectively mitigate the impact of GC wakening up all Regions when the [Hibernate Region](/tikv-configuration-file.md#hibernate-regions-experimental) feature is enabled, thus improving the execution speed in the Resolve Locks step.
- This variable specifies the way of scanning locks in the Resolve Locks step of GC. When the variable value is set to `LEGACY`, TiDB scans locks by Regions. When the value `PHYSICAL` is used, it enables each TiKV node to bypass the Raft layer and directly scan data, which can effectively mitigate the impact of GC wakening up all Regions when the [Hibernate Region](/tikv-configuration-file.md#hibernate-regions) feature is enabled, thus improving the execution speed in the Resolve Locks step.

### tidb_general_log

Expand Down
3 changes: 1 addition & 2 deletions ticdc/ticdc-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ Since v4.0.8, TiCDC supports replicating tables **without a valid index** by mod
Currently, The following scenarios are not supported:

- The TiKV cluster that uses RawKV alone.
- The [DDL operation `CREATE SEQUENCE`](/sql-statements/sql-statement-create-sequence.md) and the [SEQUENCE function](/sql-statements/sql-statement-create-sequence.md#sequence-function) in TiDB v4.0. When the upstream TiDB uses `SEQUENCE`, TiCDC ignores `SEQUENCE` DDL operations/functions performed upstream. However, DML operations using `SEQUENCE` functions can be correctly replicated.
- The [TiKV Hibernate Region](/best-practices/massive-regions-best-practices.md#method-2-enable-hibernate-region). TiCDC prevents the Region from entering the hibernated state.
- The [DDL operation `CREATE SEQUENCE`](/sql-statements/sql-statement-create-sequence.md) and the [SEQUENCE function](/sql-statements/sql-statement-create-sequence.md#sequence-function) in TiDB. When the upstream TiDB uses `SEQUENCE`, TiCDC ignores `SEQUENCE` DDL operations/functions performed upstream. However, DML operations using `SEQUENCE` functions can be correctly replicated.

TiCDC only provides partial support for scenarios of large transactions in the upstream. For details, refer to [FAQ: Does TiCDC support replicating large transactions? Is there any risk?](/ticdc/troubleshoot-ticdc.md#does-ticdc-support-replicating-large-transactions-is-there-any-risk).

Expand Down
4 changes: 2 additions & 2 deletions tikv-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,10 @@ Configuration items related to Raftstore
+ Default value: `"3s"`
+ Minimum value: `0`

### `hibernate-regions` (**Experimental**)
### `hibernate-regions`

+ Enables or disables Hibernate Region. When this option is enabled, a Region idle for a long time is automatically set as hibernated. This reduces the extra overhead caused by heartbeat messages between the Raft leader and the followers for idle Regions. You can use `raftstore.peer-stale-state-check-interval` to modify the heartbeat interval between the leader and the followers of hibernated Regions.
+ Default value: false
+ Default value: `true` in v5.0.2 and later versions; `false` in versions before v5.0.2

### `raftstore.peer-stale-state-check-interval`

Expand Down

0 comments on commit 1090e9b

Please sign in to comment.