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. Kafka 万字精讲|工作五年这些你都知道吗?

    目录 前言 一.Kafka 简介 1.1 事件流平台 1.2 Kafka 主要概念和术语 1.3 Zookeeper 二.Kafka 集群搭建和使用 2.1 使用 Docker Compose 搭建 ...

  2. (Dnc系列)借助Dnc.Events.InMemory在三分钟实现一个内存级别的事件驱动处理模型

    前言 Dnc.Events是在借鉴领域驱动设计大佬daxnet的博客基础上做的基于内存级别的EDA处理模型,不清楚EDA的童鞋请自行百度. 第一分钟 安装Nuget Dnc.Events.InMemo ...

  3. Quartz.Net系列(一):Windows任务计划程序

    1.使用此电脑=>管理  系统工具=>任务计划程序=>任务计划程序库=>创建任务  创建任务  触发器  操作  条件=>去掉只有在计算机使用交流电源时才启动此任务 创建 ...

  4. Boost程序库完全开发指南:1-开发环境和构建工具

      Boost官方于2019年12月发布的1.72版编写,共包含160余个库/组件,涵盖字符串与文本处理.容器.迭代器.算法.图像处理.模板元编程.并发编程等多个领域,使用Boost,将大大增强C++ ...

  5. 初窥门径代码起手,Go lang1.18入门精炼教程,由白丁入鸿儒,首次运行golang程序EP01

    前文再续,书接上回,前一篇:兔起鹘落全端涵盖,Go lang1.18入门精炼教程,由白丁入鸿儒,全平台(Sublime 4)Go lang开发环境搭建EP00,我们搭建起了Go lang1.18的开发 ...

  6. 鸿蒙开发丨设备内UIAbility的几种交互方式

    本文分享自华为云社区<设备内UIAbility交互:无缝体验与高级技巧>,作者: 柠檬味拥抱. UIAbility组件间交互(设备内) 在设备内,UIAbility(用户界面能力)是系统调 ...

  7. 实例解析丨一文搞定GaussDB CM服务异常

    摘要:本文主要为大家带来如何处理GaussDB CM服务异常问题. 本文分享自华为云社区<[实例状态]GaussDB CM服务异常>,作者:酷哥. 首先确认是否是虚拟机.网络故障,底层故障 ...

  8. 基于Redis + Lua脚本的设计红包雨

    摘要:红包雨是一个典型的高并发场景,短时间内有海量请求访问服务端,为了让系统运行顺畅,抢红包采用了基于 Redis + Lua 脚本的设计方案. 本文分享自华为云社区<红包雨中:Redis 和 ...

  9. 撬动百亿VRAR产业,让VR们“造”起来

    摘要:四大亮点抢先看,12月28-29日不见不散! 随着5G商用的加速及元宇宙.数字人等概念的兴起,虚拟现实技术作为未来世界的入口,正受到越来越多的关注,也将成为驱动数字经济发展和产业转型升级的关键技 ...

  10. Ngnix搭建静态网页和安装wordpress

    使用nginx搭建wordpress和静态网站.以下操作均实在ubuntu1604完成. 安装nginx apt install nginx 验证安装是否完成.在浏览器打开127.0.0.1,能够看到 ...