github-actions[bot] commented on code in PR #64075:
URL: https://github.com/apache/doris/pull/64075#discussion_r3355724847
##########
fs_brokers/cdc_client/src/main/java/org/apache/doris/cdcclient/source/reader/mysql/MySqlSourceReader.java:
##########
@@ -849,7 +849,12 @@ private BinlogSplitReader
getBinlogSplitReader(JobBaseConfig config) {
DebeziumUtils.createBinaryClient(sourceConfig.getDbzConfiguration());
final StatefulTaskContext statefulTaskContext =
new StatefulTaskContext(sourceConfig, binaryLogClient,
jdbcConnection);
- return new BinlogSplitReader(statefulTaskContext, 0);
+ int readerTag = Math.abs(config.getJobId().hashCode());
+ LOG.info(
+ "create binlog reader for job {}, thread tag =
binlog-reader-{}",
+ config.getJobId(),
+ readerTag);
+ return new BinlogSplitReader(statefulTaskContext, readerTag);
}
Review Comment:
This changes the MySQL binlog reader's Flink CDC `subtaskId`, not just the
thread-name tag. `BinlogSplitReader`/`StatefulTaskContext` use this argument to
choose the MySQL replication `server_id` from
`sourceConfig.getServerIdRange()`. Before this PR the binlog reader used index
`0`, matching the logged `getStartServerId()` and the FE validation that a
user-provided `server_id` range only has to cover `snapshot_parallelism`. With
`abs(jobId.hashCode())`, a normal job can select `start + hash` (or otherwise
fail range validation inside Flink CDC) instead of the configured range, and
two jobs can unexpectedly collide with unrelated MySQL replica IDs. Please keep
the binlog reader subtask id at `0` and solve thread-name uniqueness
separately, or explicitly prove and test that this value no longer affects
server_id selection in the bundled Flink CDC version.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]