Skip to content

Commit

Permalink
(ccr) handle large binlog and download failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring committed Jan 26, 2024
1 parent 6936b9b commit 7b8c566
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,22 @@ public TBinlog readTBinlogFromStream(DataInputStream dis) throws TException, IOE
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(1024 * 1024 * 1024);
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;
}

Expand Down

0 comments on commit 7b8c566

Please sign in to comment.