Lightning: Add Configurations to Control Remote Checksum Behavior
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
The current implementation of 'remote checksum' involves constructing a TiKV Go client and sending checksum requests in batches. However, there is an alternative implementation that involves executing the 'ADMIN CHECKSUM TABLE' SQL directly, which is a more straightforward approach. To enable this, we can define a parameter in Lightning that controls the implementation when performing remote checksum. Currently, the SQL-execution implementation only applies when the TiDB version is very old.
Furthermore, for the TiKV Go client implementation, we need to introduce some configuration parameters that can tweak certain settings. For example, in https://github.com/pingcap/tidb/blob/v6.5.2/br/pkg/checksum/executor.go#L311, we use `kv.NewVariables(&killed)` to construct the `kv.Variables`. However, this only sets the `Killed` field and leaves the other fields as default values. In some cases, we may want to set the `BackOffWeight` in the variable to control the backoff timeout when performing checksum and encountering region errors. In such situations, we can define a parameter in Lightning that controls this backoff weight.
Contributor guide
Assessment
This issue has not been assessed yet.