shyiko/mysql-binlog-connector-java

Error: java.io.IOException: Unexpected packed number byte 255

DPGrev opened this issue · 1 comments

Our replication of the binlog was fine but after a restart we are seeing the following error when using the binlog connector:

java.io.IOException: Unexpected packed number byte 255
	at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.readPackedNumber(ByteArrayInputStream.java:162) ~[mysql-binlog-connector-java-0.20.0.jar:0.20.0]
	at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.readPackedInteger(ByteArrayInputStream.java:131) ~[mysql-binlog-connector-java-0.20.0.jar:0.20.0]
	at com.github.shyiko.mysql.binlog.io.ByteArrayInputStream.readLengthEncodedString(ByteArrayInputStream.java:73) ~[mysql-binlog-connector-java-0.20.0.jar:0.20.0]
	at com.github.shyiko.mysql.binlog.network.protocol.ResultSetRowPacket.<init>(ResultSetRowPacket.java:35) ~[mysql-binlog-connector-java-0.20.0.jar:0.20.0]
	at com.github.shyiko.mysql.binlog.BinaryLogClient.readResultSet(BinaryLogClient.java:1083) ~[mysql-binlog-connector-java-0.20.0.jar:0.20.0]
	at com.github.shyiko.mysql.binlog.BinaryLogClient.fetchBinlogChecksum(BinaryLogClient.java:916) ~[mysql-binlog-connector-java-0.20.0.jar:0.20.0]
	at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:533) ~[mysql-binlog-connector-java-0.20.0.jar:0.20.0]
	at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:857) ~[mysql-binlog-connector-java-0.20.0.jar:0.20.0]

We think this is caused by the following piece of code, we are however unsure what causes it.

public Number readPackedNumber() throws IOException {
int b = this.read();
if (b < 251) {
return b;
} else if (b == 251) {
return null;
} else if (b == 252) {
return (long) readInteger(2);
} else if (b == 253) {
return (long) readInteger(3);
} else if (b == 254) {
return readLong(8);
}
throw new IOException("Unexpected packed number byte " + b);
}

Did anybody else encounter this issue?

After some research we came to the following conclusion: zendesk/maxwell#1374 (comment)