TiFlash Error: Sync schemas failed by DB::Exception: Wrong column name

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

Original topic: tiflash 报错Sync schemas failed by DB::Exception: Wrong column name

| username: TiDBer_j9d3wEwH

【TiDB Usage Environment】Production Environment
【TiDB Version】7.1.0
【Reproduction Path】Issues encountered during TiDB start/stop
【Encountered Issues: Symptoms and Impact】
【Resource Configuration】Entered the tiflash log and took a screenshot of this page
【Attachments: Screenshots/Logs/Monitoring】


Screenshot below, please take a look, any help would be greatly appreciated!

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

Please share the table structure corresponding to table_id 96616. If there is no corresponding table_id in the tiflash_replica table, check the tables and partitions tables.

SELECT * FROM INFORMATION_SCHEMA.`TIFLASH_REPLICA` a WHERE a.table_id='96616';
SELECT * FROM INFORMATION_SCHEMA.tables c WHERE c.tidb_table_id='96616';
SELECT * FROM INFORMATION_SCHEMA.partitions b WHERE b.`TIDB_PARTITION_ID`='96616';
| username: Jasper | Original post link

Is the synchronization status of this table normal?
Can you check the corresponding table with

select * from information_schema.tiflash_replica
| username: redgame | Original post link

The possibility of synchronization failure is higher.

| username: xfworld | Original post link

It seems to be a structural inconsistency issue. It is recommended to cancel the synchronization of the problematic table in TiFlash. After the cleanup is completed, restart the synchronization process (structural reconstruction).

| username: TiDBer_j9d3wEwH | Original post link

Thank you, teacher, for your help. There is no data in this table, not a single entry.

| username: TiDBer_j9d3wEwH | Original post link

Teacher, there is nothing in my INFORMATION_SCHEMA.`TIFLASH_REPLICA table.

| username: TiDBer_j9d3wEwH | Original post link

The image you provided is not accessible. Please provide the text content you need translated.

| username: TiDBer_j9d3wEwH | Original post link

Thank you for the reminder, teacher. However, my information_schema.tiflash_replica doesn’t have any data; it’s an empty table.

| username: TiDBer_j9d3wEwH | Original post link

Teacher, this one exists. Should it be deleted?

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

No, after finding this table, use ALTER TABLE tablename SET TIFLASH REPLICA 0 and then restart TiFlash to see if the error persists… Additionally, go to the host of your TiFlash node and check the corresponding directory to see if there is a t_96616 directory under /u01/tidb-data/tiflash-9000/data.

| username: TiDBer_j9d3wEwH | Original post link

Got it!! Thank you for the guidance, teacher. I’ll give it a try.

| username: TiDBer_j9d3wEwH | Original post link

Thank you very, very much, teacher. The problem has been solved!! Wishing you a happy and healthy life. Thank you, thank you.

| username: WinterLiu | Original post link

Learned a lot, the forum experts are amazing.

| username: dba远航 | Original post link

The issue caused by the table, deleting it can certainly resolve the problem, but the question is why the error occurred. I feel this is more important.

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

Someone mentioned wanting to see the table structure, possibly because the table has virtual columns or triggered a partition table-related bug.

| username: TiDBer_j9d3wEwH | Original post link

I’ll go take a look.

| username: TiDBer_j9d3wEwH | Original post link

The table structure has been uploaded, teacher.

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

This table doesn’t seem special at all… Why is there an error…
I set the TiFlash replica normally, no problem.

| username: TiDBer_j9d3wEwH | Original post link

It is indeed this table. Following your instructions, I executed ALTER TABLE ds_qth.gjzf_dw_zz SET TIFLASH REPLICA 0; and then checked under /u01/tidb-data/tiflash-9000/data in TiFlash, but there was nothing there, not even the t_96616 directory. After a direct restart, everything was resolved.