[转帖]Region Merge Config

region,merge,config · 浏览次数 : 0

小编点评

**Region Splitting:** * When the size of the region or the number of keys reaches a threshold, a Region Split happens. * In a Region Split, the region is divided into two new Regions. * The new Regions are located on the same set of TiKVs. **Region Merging:** * When the size of the region and the amount of keys shrink due to data deletion, a Region Merge can occur. * In a Region Merge, the two Regions are merged into a single larger Region. * The new Region is located on the same set of TiKVs. **Region Merge Configuration:** * Region Merge can be enabled or disabled by setting the following parameters to a non-zero value: * `max-merge-region-size`: Specifies the maximum size of the two Regions to be merged. * `max-merge-region-keys`: Specifies the maximum number of keys allowed in the two Regions to be merged. * `merge-schedule-limit`: Specifies the maximum time interval between split and merge operations. **Overall, Region Merge aims to relieve stress on Raftstore.Merge processRegion Merge by merging adjacent Regions that are no longer needed.**

正文

TiKV replicates a segment of data in Regions via the Raft state machine. As data writes increase, a Region Split happens when the size of the region or the number of keys has reached a threshold. Conversely, if the size of the Region and the amount of keys shrinks because of data deletion, we can use Region Merge to merge adjacent regions that are smaller. This relieves some stress on Raftstore.

Merge process

Region Merge is initiated by the Placement Driver (PD). The steps are:

  1. PD polls the meta information of Regions constantly.

  2. If the region size is less than max-merge-region-size and the number of keys the region includes is less than max-merge-region-keys, PD performs Region Merge on the region with the smaller one of the two adjacent Regions.

Note:

  • All replicas of the two Regions to be merged must locate on the same set of TiKVs (It is ensured by PD scheduler).
  • Newly split Regions won’t be merged within the period of time specified by split-merge-interval.
  • Region Merge won’t happen within the period of time specified by split-merge-interval after PD starts or restarts.
  • Region Merge won’t happen for two Regions that belong to different tables if namespace-classifier = table (default).

Configure Region Merge

Region Merge is enabled by default. You can use pd-ctl or the PD configuration file to configure Region Merge.

To enable Region Merge, set the following parameters to a non-zero value:

  • max-merge-region-size
  • max-merge-region-keys
  • merge-schedule-limit

You can use split-merge-interval to control the interval between the split and merge operations.

For detailed descriptions on the above parameters, refer to PD Control.

具体命令为:

tiup ctl:v6.5.3 pd config set max-merge-region-size 0
tiup ctl:v6.5.3 pd config set max-merge-region-keys 0
tiup ctl:v6.5.3 pd config set merge-schedule-limit 0

与[转帖]Region Merge Config相似的内容:

[转帖]Region Merge Config

TiKV replicates a segment of data in Regions via the Raft state machine. As data writes increase, a Region Split happens when the size of the region o

[转帖]TiDB-merge region相关问题

一、开启region merge # 控制 Region Merge 的 size 上限,当 Region Size 大于指定值时 PD 不会将其与相邻的 Region 合并 pd-ctl config set max-merge-region-size 20 # 控制 Region Merge 的

[转帖]058、集群优化之PD

PD调度基本概念 调度流程 调度中还有这还缺来了merge,例如合并空region。 store: 基本信息,容量,剩余空间,读写流量等 region: 范围,副本分布,副本状态,数据量,读写流量等 相关调度说明 balance-leader-scheduler: 保持不同节点的leader均衡ba

[转帖]062、监控指标之PD

PD相关 Grafana 监控 PD —> PD Dashboard 是否存在异常状态的TiKV Grafana 监控 PD —> Region health 大表清理后,出现了大量的空region, 空的region会干扰pd的调度。所以要及时的merge Grafana 监控 PD —> Sta

[转帖]Region 性能调优

https://docs.pingcap.com/zh/tidb/v6.5/tune-region-performance 本文介绍了如何通过调整 Region 大小等方法对 Region 进行性能调优以及如何在大 Region 下使用 bucket 进行并发查询优化。 概述 TiKV 自动将底层数

[转帖]Region is unavailable的排查总结

https://tidb.net/blog/07c99ed0#4%C2%A0%20%E4%B8%80%E4%BA%9B%E5%BB%BA%E8%AE%AE 1 region访问基本流程 tidb在访问key数据时需要获取key所在region的分布信息,在tidb 侧有一个region cache存

[转帖]Split Region 使用文档

https://docs.pingcap.com/zh/tidb/stable/sql-statement-split-region 在 TiDB 中新建一个表后,默认会单独切分出 1 个 Region 来存储这个表的数据,这个默认行为由配置文件中的 split-table 控制。当这个 Regio

[转帖]openstack中region、az、host aggregate、cell 概念

https://www.cnblogs.com/xiexun/p/14491057.html 1. region 更像是一个地理上的概念,每个region有自己独立的endpoint,regions之间完全隔离,但是多个regions之间共享同一个keystone和dashboard。(注:目前op

[转帖]TIDB TIKV 数据是怎么写入与通过Region 分割的?

https://cloud.tencent.com/developer/article/1882194 国产的分布式数据库不少,TDSQL, OB, TIDB ,等等都是比较知名的产品,使用的分布式协议也不同,有使用POSTGRES-XL ,也有从外观模仿ORACLE 的,还有借鉴各家所长自己研发的

【转帖】68.记忆集(remembered set)和写屏障(write barrier)

目录 1.记忆集(`remembered set`) 1.记忆集(remembered set) 问题:G1将堆区划分成多个region,一个region不可能是独立的,它其中存储的对象可能被其他任意region(这些region可能Old区或者Eden区)中的对象所引用。这样一来,在进行YGC的时