pingcap / pingcap/tidb

[br] BR backup retry can publish SST files from a replaced source cluster

Open
#70,040 0 comments 0 reactions 0 assignees View on GitHub
component/br found-by-ai may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/critical type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

> Evidence status: confirmed.

### 1. Minimal reproduce step (Required)

Start a checkpoint-enabled backup of cluster A to a storage prefix and interrupt it after at least one range is checkpointed. Replace the PD/TiKV cluster with cluster B behind the same configured PD addresses, retain the prefix, and retry the same BR command. Inspect the retry BackupTS, incomplete-range set, and final backupmeta data files.

### 2. What did you expect to see? (Required)

Checkpoint metadata is accepted only when its recorded source cluster identity matches the current PD cluster. A mismatch must fail before reusing BackupTS, ranges, checksums, or SST files.

### 3. What did you see instead? (Required)

CheckCheckpoint accepts the same config hash without a cluster identity check, GetTS reuses the old BackupTS, BuildProgressRangeTree reports zero incomplete current ranges, and the new backupmeta contains old-cluster.sst.

### 4. What is your TiDB version? (Required)

master 13282a8bd06b

Likely root cause and fix direction

CheckpointMetadataForBackup stores config hash and BackupTS but no actual PD cluster ID. The hash binds PD address strings rather than the cluster behind them. Retry therefore treats old range completion and SST files as current-lineage proof.

Contributor guide

Open the contributing guide

Research direction

Start by tracing BR retry handling through CheckCheckpoint, GetTS, and BuildProgressRangeTree, then inspect CheckpointMetadataForBackup and the backupmeta data-file handling. Reproduce the interrupted backup and cluster replacement described in the issue; done means a source-cluster mismatch fails before reusing BackupTS, ranges, checksums, or old-cluster SST files.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.