pingcap / pingcap/tidb

BR: Restore fails due to system table column mismatch (Create_tablespace_priv) on upgraded clusters

Open
#67,210 2 comments 0 reactions 0 assignees View on GitHub
affects-8.5 component/br contribution may-affects-7.1 may-affects-7.5 may-affects-8.1 severity/critical type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

### 1. Minimal reproduce step (Required)

1. Backup a TiDB v8.x cluster that was originally upgraded from v4.0 (carrying legacy `mysql.user` schema).
2. Restore the backup to a fresh TiDB v8.x cluster (initialized with modern schema).
3. BR fails during the system table compatibility check.

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

BR should automatically handle or ignore legacy system table column variations (like `Create_tablespace_priv` casing/enum differences) when both clusters are on the same version.

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

Restore fails with:
`[BR:Restore:ErrRestoreIncompatibleSys] incompatible system table`
`col in cluster: Create_Tablespace_Priv enum('N','Y'), col in backup: Create_tablespace_priv enum('N','Y')`

This blocks migrations of "brownfield" clusters that have a long upgrade history.

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

v8.5.0 (Source upgraded from v4.0; Target is fresh v8.5.0)

---

### Proposed Fix/Workaround
1. **Code Fix:** Relax the `CheckSysTableCompatibility` logic for known legacy schema variations.
2. **Workaround:** Provide a flag to skip system table restoration or specific compatibility checks, allowing users to manually sync users/privileges post-restore.

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.