pingcap / pingcap/tidb

[br] BR can report backup success when PD scheduler removal fails

Open
#70,034 2 comments 0 reactions 0 assignees View on GitHub
affects-7.5 affects-8.1 affects-8.5 component/br found-by-ai 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)

On a real TiKV cluster, run BR backup txn with --remove-schedulers and inject an error from PdController.RemoveSchedulers. Current source exits 0 immediately and leaves the storage directory empty. The same command without the fault writes backupmeta.

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

The scheduler-removal error must propagate as a nonzero BR exit status; no backup artifact is expected.

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

The code checks e != nil but returns stale outer err, which is nil after successful setup. BR exits 0 with an empty backup directory.

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

master 13282a8bd06b; backup, raw backup, txn backup, EBS backup, resolve KV data

Likely root cause and fix direction

Five top-level BR paths bind scheduler-removal failure to e but return errors.Trace(err). The checked error does not dominate the terminal command result.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the five top-level BR paths that use PdController.RemoveSchedulers and compare the checked scheduler-removal error with the terminal command result. Reproduce the injected failure on a TiKV cluster with --remove-schedulers and verify that BR exits nonzero and does not create a backup artifact.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.