[FLINK-39200][mysql] Skip insert/update/delete binlog deserialization of unsubscribed tables in MySql CDC binary log client.#4302
Conversation
… of unsubscribed tables in MySql CDC binary log client.
|
Thank u for your contributor and i left some comment. |
|
@ThorneANN Thank you for your comment. |
Yes, the point that confuses me is that I noticed you added a lot of event serialization classes because I think you only need to filter tableids |
|
May be we modify |
As the code show , flink-cdc also skip the data without capture table ,but always deserializer dataEvent's mata |
|
This pr i edit for last month ,u can cc .https://github.com/ThorneANN/flink-cdc/tree/serrizer-only-tablels |
This closes FLINK-39200.
What is the purpose of the change
Currently, the MySQL row event deserializers in Flink CDC always fully deserialize WRITE/UPDATE/DELETE binlog events for all tables, regardless of whether the tables are actually subscribed by the connector. This leads to unnecessary CPU and memory overhead, especially when only a small portion of tables are monitored.
This PR implements early skipping of deserialization for unsubscribed tables in binary log client to improve performance. This optimization is applied by default. No table option is added to allow turning off this improvement, since there is no valid use case to deserialize events for unsubscribed tables.
Brief change log
TableIdFilterto support filtering tables during event deserialization.WriteRowsEventDataDeserializer,UpdateRowsEventDataDeserializer,DeleteRowsEventDataDeserializer) that support skipping deserialization for excluded tables.MySqlStreamingChangeEventSourceto use theTableIdFilterbased on the connector's table subscription configuration.Verifying this change
This change is verified by existing tests:-MySqlPipelineITCase-BinlogSplitReaderTestThe second commit add unit tests.
Performance benchmarks can be added later to quantify the CPU/memory savings, which could be discussed in FLINK-37743
Does this pull request potentially affect one of the following parts:
Documentation