Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: cdc安全模式
[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
v6.6.0
Regarding the safe mode of CDC, the documentation mentions
Block Quote
Before version v6.1.3,safe-mode
was set totrue
by default, meaning allINSERT
andUPDATE
statements were converted toREPLACE INTO
statements. From version v6.1.3 onwards, the system can automatically determine whether there is duplicate data downstream, andsafe-mode
is changed tofalse
by default. When the system determines there is no duplicate data downstream, it will directly synchronizeINSERT
andUPDATE
statements.
How does CDC determine if there is duplicate data downstream? Does it query the downstream based on the primary key? I don’t seem to see any judgment in the code.