ziyanTOP opened a new pull request, #4413: URL: https://github.com/apache/flink-cdc/pull/4413
## What is the purpose of the change Fix chunk splitting and binlog event routing issues when MySQL collation differs from Java's natural String ordering. Java \`String.compareTo()\` is case-sensitive (Unicode code point order), while MySQL collations like \`utf8mb4_general_ci\` are case-insensitive. This mismatch causes chunk boundaries computed by Java to diverge from actual MySQL row ordering, leading to premature unbounded chunks, overlapping splits, or lost binlog events. See [FLINK-39749](https://issues.apache.org/jira/browse/FLINK-39749) for details. ## Brief change log - Introduce \`ChunkKeyCompareMode\` enum: \`DEFAULT\`, \`CASE_INSENSITIVE\`, \`BINARY\` - \`DEFAULT\`: preserves existing behavior (\`String.compareTo()\`) - \`CASE_INSENSITIVE\`: uses \`String.compareToIgnoreCase()\` for Java-side comparisons - \`BINARY\`: injects \`BINARY\` keyword in SQL predicates and uses byte-level comparison in Java - Cover all three API layers: DataStream API, Flink SQL, Pipeline YAML - Update documentation (EN + ZH) and add test coverage ## Verifying this change This change is already covered by existing tests (\`MySqlTableSourceFactoryTest\`) and has been verified in a production Pipeline job (MySQL -> Paimon) with \`CHAR(36)\` UUID primary key and \`utf8mb4_general_ci\` collation. ## Does this pull request potentially affect one of the following parts - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with \`@Public(Evolving)\`: no - The serializers: no - The runtime per-record code paths (performance sensitive): yes (affects chunk key comparison in snapshot/binlog phases) - Anything that affects deployment or recovery: no - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? yes - If yes, how is the feature documented? docs -- 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]
