When Lightning's duplicate-detection encountered a retryable error, it will retry without back-off
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
1. Run Lightning with duplicate detection enabled (set conflict strategy to not "none")
2. After `[detect-dupe] collect remote duplicate keys` started, perform some region leader transfer / split / merge
* Ideally this should never happen because of import-mode and pause scheduler, but both of them can be disabled.
3. Note a bunch of `process remote dupTask encounters region error, retrying` in the log.
### 2. What did you expect to see? (Required)
There should not be too many errors, as the detector should wait for the region cache to be refreshed.
### 3. What did you see instead (Required)
Lightning retried without any backoff. So even with 1800 retries it may still be using the old region → store mapping.
https://github.com/pingcap/tidb/blob/b25074f843ae77f4edfd2b9e558bd51a399ddb07/pkg/lightning/backend/local/duplicate.go#L1005-L1015
### 4. What is your TiDB version? (Required)
Contributor guide
Assessment
This issue has not been assessed yet.