-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[Feature][MySQL CDC] MySQL cdc support start by time #9735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
milliseconds?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dyp12 We should support 8.4 too. Please refer e338743#diff-a059ddeb198852981f568a6087e543c358b90c5116cd918bcdf07c32e4008324R77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dyp12 We should support 8.4 too. Please refer e338743#diff-a059ddeb198852981f568a6087e543c358b90c5116cd918bcdf07c32e4008324R77
fixed it
| public static long getBinlogTimestamp(BinaryLogClient client, String binlogFile) | ||
| throws IOException, InterruptedException { | ||
|
|
||
| ArrayBlockingQueue<Long> binlogTimestamps = new ArrayBlockingQueue<>(1); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
MySqlOffsetContextwhen 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
|
Please rebase dev because we merged #9720 |
i fix it |
Hisoka-X
left a comment
There was a problem hiding this 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
Carl-Zhou-CN
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Purpose of this pull request
close #9144
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide