[fix](ccr) handle large binlog (#30435)

This commit is contained in:
Yongqiang YANG
2024-01-28 17:52:39 +08:00
committed by yiguolei
parent 92dc395f9a
commit bfdc41d37b
2 changed files with 18 additions and 1 deletions

View File

@ -457,10 +457,22 @@ public class BinlogManager {
int length = dis.readInt();
byte[] data = new byte[length];
dis.readFully(data);
TMemoryInputTransport transport = new TMemoryInputTransport(data);
Boolean isLargeBinlog = length > 8 * 1024 * 1024;
if (isLargeBinlog) {
LOG.info("a large binlog length {}", length);
}
TMemoryInputTransport transport = new TMemoryInputTransport();
transport.getConfiguration().setMaxMessageSize(Config.max_binlog_messsage_size);
transport.reset(data);
TBinaryProtocol protocol = new TBinaryProtocol(transport);
TBinlog binlog = new TBinlog();
binlog.read(protocol);
if (isLargeBinlog) {
LOG.info("a large binlog length {} type {}", length, binlog.type);
}
return binlog;
}