A large table with hundreds of millions of rows was truncated, and the GC setting was 10 minutes. It exceeded the GC time, so flashback cannot be used, and there is no backup. In this case, is there any way to recover this table?

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

Original topic: 上亿的一张大表,gc设置的为10分钟,被truncate掉,超过了gc时间,使用flashback无法闪回,也没有备份,这种情况下,还有什么办法恢复这张表不?

| username: vcdog

[Test Environment for TiDB] Testing
[TiDB Version] v6.5.0
[Reproduction Path] What operations were performed to cause the issue
[Encountered Issue: Phenomenon and Impact] A large table with over a hundred million rows was truncated, and the GC was set to 10 minutes. It exceeded the GC time, and flashback could not restore it. There is no backup. In this case, is there any way to recover this table?
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

| username: hey-hoho | Original post link

:rofl: This is tough…

| username: cassblanca | Original post link

Truncate is a DDL operation, essentially a data file header pointer issue. If there is a tool that can directly scan data blocks, it can theoretically be recovered as long as it hasn’t been overwritten.

| username: zhanggame1 | Original post link

TiDB is not a data block storage, once it is garbage collected, it is really physically deleted.

| username: 像风一样的男子 | Original post link

Is this the legendary “delete the database and run”?

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

This is a complete disaster on TiDB. Once the GC time passes and the GC starts, the SST files will be wiped out…

| username: WalterWj | Original post link

Truncate GC is not very slow, it’s unsafe remove… There’s no hope for this, find a backup.

| username: YuchongXU | Original post link

No more.

| username: 啦啦啦啦啦 | Original post link

Do you have a backup? If not, it’s a lost cause. Or has the data been synchronized to the downstream? See if you can retrieve it from there.

| username: redgame | Original post link

No way.

| username: zhaokede | Original post link

If there is no data backup, there is basically no hope.

| username: BraveChen | Original post link

If the data comes from application collection, you can also check the application logs for recovery.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.