Compatibility Issues with BR Backup System Tables

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: BR备份系统表兼容问题

| username: songxuecheng

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Problem Phenomenon and Impact]

System table incompatibility during same version BR backup migration

[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]
image

image

| username: WalterWj | Original post link

Does the table structure upstream and downstream look the same?

| username: songxuecheng | Original post link

This is from the source database. The above is from the target database.

| username: WalterWj | Original post link

It seems to be different. So the error is understandable.

| username: WalterWj | Original post link

My cluster is 713, and it’s like this. Is the source database upgraded from a lower version? It feels like there might be something wrong with the initialization of this metadata table. :thinking:

| username: songxuecheng | Original post link

Did the source database start upgrading from version 4.0 and encountered issues during the upgrade?

| username: WalterWj | Original post link

It seems like it could be an upgrade bug. After upgrading, the tidb-server will initialize the system tables, and it feels like the attribute of the initialized system table got lost.

I think you can try manually modifying the table structure of the original table. However, I’m not sure about the risks.

It’s better not to back up the system tables with br. Use a script to migrate the account passwords instead.
I wrote one before: PingCAP/out_user.py at master · WalterWj/PingCAP · GitHub

| username: songxuecheng | Original post link

OK, after removing the system table, it returned to normal.

| username: songxuecheng | Original post link

How to use this script?

| username: songxuecheng | Original post link

Okay. I saw the code. You input the source address, account, and password, then write the account to a file, right? And then execute it on the target, right?

| username: songxuecheng | Original post link

Military boss.


For database names like this, how to adjust the script to output database?

| username: WalterWj | Original post link

Just add `` to escape in batches. Handle it manually.