Skip to content

Conversation

@dyp12
Copy link
Contributor

@dyp12 dyp12 commented Aug 20, 2025

Purpose of this pull request

close #9144

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@Override
public Offset timestamp(long timestamp) {
throw new UnsupportedOperationException("not supported create new Offset by timestamp.");
// mysql binlog timestamp is second, so we need to divide 1000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

milliseconds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

milliseconds?

in BinlogOffset timestamp is second

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so why we should / 1000? https://github.com/apache/seatunnel/pull/9735/files/f780aa68a6e524e1401734506fbb5d867176c293

the timestamp is milliseconds, but in BinlogOffset timestamp is second. so /1000 make milliseconds to second


public static BinlogOffset findBinlogOffsetBytimestamp(
JdbcConnection jdbc, BinaryLogClient client, long timestamp) {
final String showBinaryLogStmt = "SHOW BINARY LOGS";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @hawk9821 . After this PR merged we should update this for 8.4?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static long getBinlogTimestamp(BinaryLogClient client, String binlogFile)
throws IOException, InterruptedException {

ArrayBlockingQueue<Long> binlogTimestamps = new ArrayBlockingQueue<>(1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we still use queue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we still use queue?

sorry,i fixed it

super.handleEvent(partition, offsetContext, event);
}

private void updateOffsetPosition(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why we must update MySqlOffsetContext when skip data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why we must update MySqlOffsetContext when skip data?

update MySqlOffsetContext,then checkpoint will save latest offset,when restore,only begin from save offset,not from earliest. in MySqlStreamingChangeEventSource.handleEvent also update it

@Hisoka-X
Copy link
Member

Please rebase dev because we merged #9720

@dyp12
Copy link
Contributor Author

dyp12 commented Aug 23, 2025

Please rebase dev because we merged #9720

i fix it

Hisoka-X
Hisoka-X previously approved these changes Aug 25, 2025
Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if ci passes. cc @hawk9821

Copy link
Member

@Carl-Zhou-CN Carl-Zhou-CN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@Hisoka-X Hisoka-X merged commit b6c5d94 into apache:dev Aug 27, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature][MySQL CDC] MySQL cdc support start by time

3 participants