Skip to content

Conversation

@lzshlzsh
Copy link
Contributor

EOFException will happen when upgrading from mysql-cdc 2.2.0 and restoring from a savepoint. The exception stack is ac follows:
java.io.EOFException at org.apache.flink.core.memory.DataInputDeserializer.readBoolean(DataInputDeserializer.java:125) at com.ververica.cdc.connectors.mysql.source.split.MySqlSplitSerializer.deserializeSplit(MySqlSplitSerializer.java:165) at com.ververica.cdc.connectors.mysql.source.split.MySqlSplitSerializer.deserialize(MySqlSplitSerializer.java:124)

The reason is that isSuspended flag is serialized for MySqlBinlogSplit in #996 which results in state incompatibility and we should increase serializer version normally, but we did not.

We can fix the problem simply by checking whether there is data left in buffer as isSuspended flag is the last field.

@leonardBang leonardBang self-requested a review August 12, 2022 03:10
Copy link
Contributor

@ruanhang1993 ruanhang1993 left a comment

Choose a reason for hiding this comment

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

Thanks for your work, @lzshlzsh . LGTM.

if (version >= 3) {
totalFinishedSplitSize = in.readInt();
if (version > 3) {
if (version > 3 && in.available() > 0) {
Copy link
Contributor

@ruanhang1993 ruanhang1993 Aug 17, 2022

Choose a reason for hiding this comment

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

I think this code should be like :

if (version > 3) {
    // Descirbe the bug in PR#996.
    if (in.available() <= 0 && version != 4) {
        throw new IllegalStateException("Expected more info for the split.");
    }
    isSuspended = in.readBoolean();
}

IMO, change like this will not hide bugs in other future versions. But the code I provide doesn't look pretty. ;)

@yuxiqian
Copy link
Member

Hi @lzshlzsh, sorry for the delay of this PR. Could you please rebase it to latest master branch since there’s been lots of changes in Flink CDC repo since your original commit? Kindly reminder that com.ververica.cdc.connectors.mysql package has been moved to org.apache.flink.cdc.connectors.mysql.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Jul 17, 2024
@github-actions github-actions bot removed the Stale label Jul 26, 2024
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added Stale and removed Stale labels Sep 24, 2024
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Nov 24, 2024
@github-actions
Copy link

This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request.

@github-actions github-actions bot closed this Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants