Skip to content

Wrong table ID used in MQ open protocol/simple protocol output for partitioned tables #2219

@wlwilliamx

Description

@wlwilliamx

Currently, when TiCDC outputs data to MQ downstream using open protocol or simple protocol, the message includes the logical table ID for partitioned tables instead of the physical table ID.

This causes inconsistencies, since downstream consumers expect the physical table ID to correctly distinguish partitions.

After review, we found that in our codebase, all TableInfo representing a physical table (rather than a logical table) should carry the physical table ID. However, this is not handled properly right now.

To fix this, we should update the following places to ensure the physical table ID is set correctly:
• persist_storage_ddl_handlers.go:
• extractTableInfoFunc
• buildDDLEventFunc

Expected Behavior:
• All TableInfo instances representing physical tables should have their physical table ID set.
• Output to MQ downstream (open protocol / simple protocol) should contain the correct physical table ID.

Impact:
• Downstream consumers may misinterpret partitioned table events because of incorrect table ID usage.

Next Steps:
• Update the logic in extractTableInfoFunc and buildDDLEventFunc to ensure physical table IDs are always correctly set for physical tables.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions