# Software Architecture: `RegionRequestSender`

+ Deal with `region` errors (take some common `region` errors as example):
  + **Not Leader** (`TiKV` respond that the `peer` is not `leader` of the region)
    + Update `leader` info in region cache
    + Retry on new leader
  + **Epoch Not Match** (`TiKV` respond that the `region` meta changed)
    + Invalide metadata cache
    + Retry from `"get region metadata from PD"`
  + **Server Is Busy** (`TiKV` respond that it’s too busy to process the request)
    + Exponential backoff with equal jitter (from 20ms ~ 100ms by default) 
    + Retry

![`smart`](TiVKClientInterfaces_aa_001_20221027.png)

------------------------------------------------------------
Exponential backoff with equal jitter: `https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/`
