pingcap / pingcap/tidb

Lightning: Add Configurations to Control Remote Checksum Behavior

Open
#44,711 0 comments 0 reactions 0 assignees View on GitHub
type/enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.