ddl/dxf: precheck TiKV disk space and report actual TiKV capacity increase for add index in local sort and global sort
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
### Background
In DXF add index, both local sort and global sort eventually write new index data into TiKV through the worker execution path.
Today, we still have two observability / safety gaps in this flow:
1. Before the TiDB worker starts executing, TiDB does not proactively check whether TiKV has enough free disk space for the incoming add-index workload.
2. After the add-index job finishes, TiDB does not report how much TiKV capacity was actually added by the job.
This means the job may start and run for a while before hitting TiKV-side disk pressure, and operators also cannot easily understand the real storage cost introduced by the add-index job.
Related background:
- #60005
### Goal
Improve DXF add-index safety and observability for both local sort and global sort by:
- adding a TiKV disk-space precheck before the TiDB worker starts execution
- reporting the actual observed TiKV capacity increase caused by the add-index job after execution
Contributor guide
Assessment
This issue has not been assessed yet.