# Scheduling


![left](./student-guide/diagram/25-Generation-and-execution-of-schedules-01-01.png)

------------------------------------------------------------

- The TiKV node periodically reports two heartbeat messages, StoreHeartbeat and RegionHeartbeat, to the PD. StoreHeartbeat contains data such as basic information of the Store, capacity, remaining space, reads and writes traffic, etc., and RegionHeartbeat includes data such as region range, replica distribution, replica status, data volume, and reads and writes traffic. PD combed and dumped this information to build the cluster data distribution ClusterCache

- PD runs multiple kinds of schedulers, schedulers. Different schedulers generate Operators to be executed based on the information of ClusterCache based on their own logic and requirements, considering various restrictions and constraints

- The generated Operator does not start executing immediately, but first enters a wait queue managed by the Operator. Operators will be taken out of the waiting queue in a certain amount of concurrency according to the configuration. The execution process is to send each Operator Step to the Leader of the corresponding region in turn

- After TiKV finishes executing the Operator, it is then reported to Execution via RegionHeartbeat, marked as finished or timeout, and removed from the execution list
