Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: Truncate table 会导致tiflash引擎短暂缺失
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.
Which version of TiFlash is it?
Will it eventually recover?
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.
It will recover by itself.
From occurrence to self-recovery, it takes about one second. I don’t know what the principle is.
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.
TiFlash updates data asynchronously, which may result in significant delays.