lvyanquan commented on code in PR #4165:
URL: https://github.com/apache/flink-cdc/pull/4165#discussion_r2591727125
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/test/java/org/apache/flink/cdc/connectors/mysql/debezium/reader/BinlogSplitReaderTest.java:
##########
@@ -786,6 +788,94 @@ void testReadBinlogFromGtidSet() throws Exception {
assertEqualsInOrder(Arrays.asList(expected), actual);
}
+ /**
+ * In a bad case, it will skip the rest records whitch causes infinite
wait for empty data. So
+ * it should has a timeout to avoid it.
Review Comment:
whitch => which.
Could you explain when will a 'bad case' happen?
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/offset/BinlogOffset.java:
##########
@@ -193,7 +193,11 @@ public int compareTo(BinlogOffset that) {
if (gtidSet.equals(targetGtidSet)) {
long restartSkipEvents = this.getRestartSkipEvents();
long targetRestartSkipEvents = that.getRestartSkipEvents();
- return Long.compare(restartSkipEvents,
targetRestartSkipEvents);
+ if (restartSkipEvents != targetRestartSkipEvents) {
+ return Long.compare(restartSkipEvents,
targetRestartSkipEvents);
+ }
+ // The completed events are the same, so compare the row
number ...
+ return Long.compare(this.getRestartSkipRows(),
that.getRestartSkipRows());
Review Comment:
It is reasonable for me.
Could @yuxiqian or @ruanhang1993 double check for this too?
--
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]