Where should the code logic for load-based split of regions in TiKV be located?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiKV的load based split拆分region对应代码逻辑应该在哪?

| username: dongb0

I read the blog on TiKV Split source code analysis, but I didn’t find the code logic for splitting based on load. Load Based Split is said to be a feature added after version 4.0. Is the splitting done on PD?

| username: mayjiang0203 | Original post link

There are three methods to trigger region split in TiDB:

  1. TiDB trigger: Manually triggered through DDL SQL, split table xxx;
  2. PD trigger: Triggered through PD API /regions/split or by creating an Operator with pd-ctl;
  3. TiKV trigger: Includes two types, one is raft-driven split check, commonly triggered when the size exceeds the threshold, and the other is load split.
    Core code reference:
    tikv/components/raftstore/src/store/worker/split_controller.rs at b0f67e6128e4596367dba7b0400065b2496c65a3 · tikv/tikv · GitHub
| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.