RESTORE recovery abnormal DDL job rollback, error msg: Invalid DDL job%!

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

Original topic: RESTORE恢复异常DDL job rollback, error msg: Invalid DDL job%!

| username: zxxz

[Test Environment] Testing environment
[TiDB Version] v6.3.0
[Encountered Problem: Symptoms and Impact]
Backup data using BACKUP DATABASE * TO 'local:///data/BACKUP/2024/02/29/'; works fine.
However, restoring to another cluster of the same version results in an error:
Restore command: RESTORE DATABASE * FROM 'local:///data/BACKUP/2024/02/29/';
Error: ERROR 8125 (HY000): Restore failed: [ddl:8204]DDL job rollback, error msg: Invalid DDL job%!(EXTRA string=table, model.SchemaState=public)

[Attachments: Screenshots/Logs/Monitoring]

New cluster phenomenon: The database is created, but only a few tables (not all) are restored.

| username: zhanggame1 | Original post link

This feature might not be reliable.

| username: Kongdom | Original post link

Yes, I saw that the BACK command was also an experimental feature before. In this case, it might be necessary to raise an issue on GitHub.

| username: zxxz | Original post link

I used the br tool. TiDB 快照备份与恢复使用指南 | PingCAP 文档中心

| username: Kongdom | Original post link

Yes, it is best to use non-experimental features in production systems. Experimental features should only be used during validation and learning.

| username: xmlianfeng | Original post link

Let’s still use br.

| username: xfworld | Original post link

Check if there are any unfinished DDL jobs?

| username: Jellybean | Original post link

First of all, this error is likely a bug in the version. If it’s a test environment, you can check whether there are any ongoing DDL job tasks in the downstream cluster. Since the Restore command is driven by the TiDB server in the command line terminal, you can find more detailed information about this restore execution error in the tidb.log.

| username: DBAER | Original post link

BR is still more reliable.

| username: tidb菜鸟一只 | Original post link

Check the DDL logs to see which table’s creation statement is abnormal?

| username: dba远航 | Original post link

This tool still has issues.