lvyanquan commented on code in PR #3902:
URL: https://github.com/apache/flink-cdc/pull/3902#discussion_r1950195235


##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/offset/BinlogOffset.java:
##########
@@ -232,7 +232,9 @@ public int compareTo(BinlogOffset that) {
             // compared ...
             long timestamp = this.getTimestampSec();
             long targetTimestamp = that.getTimestampSec();
-            return Long.compare(timestamp, targetTimestamp);
+            if (timestamp != 0 && targetTimestamp != 0) {
+                return Long.compare(timestamp, targetTimestamp);

Review Comment:
   This change is necessary because that if the TimestampSec is 0, the 
assumption of `These are from different servers, and their binlog coordinates 
are not related` is not correct, these two BinlogOffsets could come from the 
same server.



-- 
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]

Reply via email to