8000 fix: rw-split user are not limited by maxPacketSize of dble by LUAgam · Pull Request #3710 · actiontech/dble · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: rw-split user are not limited by maxPacketSize of dble #3710

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

Merged
merged 1 commit into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.actiontech.dble.net.executor.ThreadPoolStatistic;
import com.actiontech.dble.net.mysql.AuthPacket;
import com.actiontech.dble.net.mysql.ErrorPacket;
import com.actiontech.dble.net.mysql.MySQLPacket;
import com.actiontech.dble.net.mysql.OkPacket;
import com.actiontech.dble.net.service.*;
import com.actiontech.dble.services.manager.ManagerService;
Expand Down Expand Up @@ -172,6 +171,8 @@ public boolean isDoingTask() {
return doingTaskThread != null;
}

public void checkMaxPacketSize(byte[] data) {
}

@Override
public void consumeSingleTask(ServiceTask serviceTask) {
Expand All @@ -181,10 +182,7 @@ public void consumeSingleTask(ServiceTask serviceTask) {
if (!executeTask.isReuse()) {
this.setPacketId(executeTask.getLastSequenceId());
}
byte[] data = executeTask.getOrgData();
if (data.length - MySQLPacket.PACKET_HEADER_SIZE >= SystemConfig.getInstance().getMaxPacketSize()) {
throw new IllegalArgumentException("Packet for query is too large (" + data.length + " > " + SystemConfig.getInstance().getMaxPacketSize() + ").You can change maxPacketSize value in bootstrap.cnf.");
}
checkMaxPacketSize(executeTask.getOrgData());
}

super.consumeSingleTask(serviceTask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,13 @@ public void stmtExecute(byte[] data, Queue<byte[]> dataQueue) {
}
}

@Override
public void checkMaxPacketSize(byte[] data) {
if (data.length - MySQLPacket.PACKET_HEADER_SIZE >= SystemConfig.getInstance().getMaxPacketSize()) {
throw new IllegalArgumentException("Packet for query is too large (" + data.length + " > " + SystemConfig.getInstance().getMaxPacketSize() + ").You can change maxPacketSize value in bootstrap.cnf.");
}
}

public void stmtFetch(byte[] data) {
if (prepareHandler != null) {
prepareHandler.fetch(data);
Expand Down
0