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的更多相关文章

  1. iis6|iis7|配置URLRewriter|64位操作系统下|.net2.0|.net4.0|配置URLRewriter|Web.config配置详情

    想必很多ASP.NET的码友们在IIS配置伪静态被严重纠结过不止一次两次,本园主经过多次站点伪静态配置,总结了一下,IIS版本:IIS 6.IIS 7,服务器:Windows Server 2003. ...

  2. 解决error: Your local changes to the following files would be overwritten by merge

    在项目里我们一般都会把自己第一次提交的配置文件忽略本地跟踪 1 [Sun@webserver2 demo]$ git update-index --assume-unchanged <filen ...

  3. HBase相关

    hadoop和hbase节点添加和单独重启 有时候hadoop或hbase集群运行时间久了后,某些节点就会失效,这个时候如果不想重启整个集群(这种情况在很多情况下已经不被允许),这个时候可以单独重启失 ...

  4. 服务性能监控之Micrometer详解

    Micrometer 为基于 JVM 的应用程序的性能监测数据收集提供了一个通用的 API,支持多种度量指标类型,这些指标可以用于观察.警报以及对应用程序当前状态做出响应. 通过添加如下依赖可以将 M ...

  5. tidb 杂记

    tidb_biuil_stats_concurrency 执行analyze table时会分成多个小任务,可以同时执行的任务数量.tidb_distsql_scan_concurrency 在执行分 ...

  6. Lind.DDD.IoC依赖注入与面向方面的实现

    回到目录 IoC是解耦的灵魂,很难想像一个框架中没有IoC会变成什么样子,Lind.DDD里的IoC是通过Unity实现的,由依赖注入(unity)和方法拦截组成(Interception),依赖注入 ...

  7. 介绍开源的.net通信框架NetworkComms框架之九 合并DLL

    原文网址: http://www.cnblogs.com/csdev Networkcomms 是一款C# 语言编写的TCP/UDP通信框架  作者是英国人  以前是收费的 目前作者已经开源  许可是 ...

  8. C#动态属性(.NET Framework4.5支持)

    获取方法: /* 使用方法: 1. 在web.config 的<configSections> 节点中添加 <section name="customConfigs&quo ...

  9. hbase基本结构

    HBASE  基本结构一.overview1. hbase <=> NOSQL     不错,hbase 就是某种类型的nosql 数据库,唯一的区别就是他支持海量的数据.    hbas ...

  10. 大规模视觉识别挑战赛ILSVRC2015各团队结果和方法 Large Scale Visual Recognition Challenge 2015

    Large Scale Visual Recognition Challenge 2015 (ILSVRC2015) Legend: Yellow background = winner in thi ...

随机推荐

  1. Pikachu漏洞靶场 PHP反序列化

    PHP反序列化 查看源码,以下为关键代码: class S{ var $test = "pikachu"; function __construct(){ echo $this-& ...

  2. pacman下载时经常出现Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds

    问题 我在manjaro系统上使用pacman下载软件的时候,经常出现以下报错: 错误:无法从 mirrors.tuna.tsinghua.edu.cn : Operation too slow. L ...

  3. ThreadLocal真的会造成内存泄漏吗?

    ThreadLoca在并发场景中,应用非常多.那ThreadLocal是不是真的会造成内存泄漏?今天给大家做一个分享,个人见解,仅供参考. 1.ThreadLocal的基本原理 简单介绍一下Threa ...

  4. static、final、private是否可以修饰抽象方法?

    1.static和abstract:是不能共存的.static是为了方便调用,abstract是为了给子类重写,没有方法体. 2.final和abstract:是互相冲突的,final修饰的方法不能重 ...

  5. 如何解决windos系统关闭nginx进程之后仍然可以访问?

    1.停止Nginx服务的四种方法 从容停止服务 这种方法较stop相比就比较温和一些了,需要进程完成当前工作后再停止. nginx -s quit 立即停止服务 这种方法比较强硬,无论进程是否在工作, ...

  6. 第九部分_Shell脚本之case语句

    case语句 关键词:确认过眼神,你是对的人 case语句为多重匹配语句 如果匹配成功,执行相匹配的命令 1. 语法结构 说明:pattern表示需要匹配的模式 case var in #定义变量;v ...

  7. DevSecOps“内置安全保护”,让软件研发“天生健康”

    摘要:我们主要是围绕安全架构设计保证安全落地有法可依,进行威胁建模让安全落地有迹可循.做好隐私和敏感数据保护让安全落地在每一个细节和实处这几个方面进行阐述. 本文分享自华为云社区<DevSecO ...

  8. Go--发起HTTP请求

    一.HTTP请求 根据 HTTP 标准,HTTP 请求可以使用多种请求方法.在日常开发中大多数会用到 5 种请求方法: GET.POST.PUT.PATCH 和 DELETE 方法 描述 GET 请求 ...

  9. CPI 访问需验证的HTTP接口

    CPI访问外围系统接口时,有时需要先访问验证接口,获取AccessToken或得到账密,然后访问具体接口时,将获取到的验证结果传入具体接口进行访问 1.OAuth2.0 AccessToken方式 1 ...

  10. POJ 1456 Supermarket【贪心 + 并查集】

    http://poj.org/problem?id=1456 题意:给你 N 件不同的商品,每件商品最多可以买一次.每件物品对应两个值 pi di pi 表示物品的价值,di 表示可以买的最迟时间(也 ...