morozov opened a new pull request, #4048: URL: https://github.com/apache/flink-cdc/pull/4048
There is a redundant condition and a misleading comment in `MySqlSnapshotSplitAssigner#captureNewlyAddedTables()` that complicate understanding of the code: https://github.com/apache/flink-cdc/blob/164671558ad41751d8c250b37f3341afecbba413/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/assigners/MySqlSnapshotSplitAssigner.java#L280-L285 By the time when the above condition is being evaluated, an identical condition has been already evaluated above: https://github.com/apache/flink-cdc/blob/164671558ad41751d8c250b37f3341afecbba413/flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/assigners/MySqlSnapshotSplitAssigner.java#L226-L228 Therefore, the second evaluation will always result in `true` and thus is redundant. ### Code Change History Prior to https://github.com/apache/flink-cdc/pull/3519, table discovery would happen in any assigner status, so the condition in the end of the method made sense. Together with adding this condition in the beginning of the method, https://github.com/apache/flink-cdc/pull/3519 should have removed it from the end. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
