Truncate table will cause a temporary loss of the TiFlash engine

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

Original topic: Truncate table 会导致tiflash引擎短暂缺失

| username: Running

Set up two TiDB server nodes (A and B), where one engine (B) only includes the TiFlash engine to provide analytical services externally, and engine (A) includes the TiKV engine to provide write services. When truncating TiDB server (A), accessing TiDB server (B) will show the above prompt.

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

Which version of TiFlash is it?

| username: MrSylar | Original post link

Will it eventually recover?

| username: redgame | Original post link

If the Truncate operation on node A is not correctly synchronized to the TiFlash engine on node B, there may be error messages due to metadata inconsistency when accessing node B.

| username: Running | Original post link


| username: Running | Original post link

It will recover by itself.

| username: Running | Original post link

From occurrence to self-recovery, it takes about one second. I don’t know what the principle is.

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

I suspect that at the TiKV level, truncating a table marks all keys as expired data at once. This synchronization to TiFlash takes some time, and during the synchronization process, the TiFlash engine cannot be used.

| username: zhanggame1 | Original post link

TiFlash updates data asynchronously, which may result in significant delays.