TiDB CDC Error: [CDC:ErrExpressionColumnNotFound]

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

Original topic: tidb CDC 报错Error: [CDC:ErrExpressionColumnNotFound]

| username: TiDBer_rYOSh9JN

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
V6.5.0
[Reproduction Path] What operations were performed when the issue occurred
Using TiCDC to synchronize TiDB data to MySQL
[Encountered Issue: Issue Phenomenon and Impact]
Prompt indicates that the field cannot be found,
This field was added 5 minutes ago through ALTER TABLE ADD COLUMN
And this field exists in both TiDB and downstream MySQL
Error: [CDC:ErrExpressionColumnNotFound] invalid filter expression(s). Cannot find column ‘col20’ from table ‘db1.test’ in: col20 != ‘1’
After restarting TiDB, the CDC task can start normally

Question: Does it feel like TiDB’s metadata needs to be refreshed? What command can be used to refresh TiDB’s metadata?

[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]

| username: ShawnYan | Original post link

What does this condition mean?
Are the structures of both tables exactly the same?

| username: TiDBer_rYOSh9JN | Original post link

The table structure is the same, this means conditional filtering, only synchronizing the part of the data that meets this condition.

| username: knull | Original post link

The synchronization of DDL should be a process; if your DDL hasn’t been synchronized yet and you’ve already created tasks and filters, it will report an error.

Therefore, you can first check whether the DDL has been synchronized (there should be related DDL logs in the CDC logs).