Skip to content

Commit

Permalink
Merge pull request actiontech#3058 from actiontech/other/2
Browse files Browse the repository at this point in the history
ddl's prepare-stage must send the master instance
  • Loading branch information
LUAgam authored Jan 10, 2022
2 parents a49f5e4 + de6f500 commit 2355524
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,18 @@ public void execute() throws Exception {
} else {
node.setRunOnSlave(rrs.getRunOnSlave());
ShardingNode dn = DbleServer.getInstance().getConfig().getShardingNodes().get(node.getName());
dn.getConnection(dn.getDatabase(), session.getShardingService().isTxStart(), sessionAutocommit, node, this, node);
dn.getConnection(dn.getDatabase(), isMustWrite(), sessionAutocommit, node, this, node);
}
}
} finally {
TraceManager.finishSpan(session.getShardingService(), traceObject);
}
}

protected boolean isMustWrite() {
return session.getShardingService().isTxStart();
}

protected void executeInExistsConnection(BackendConnection conn, RouteResultsetNode node) {
TraceManager.TraceObject traceObject = TraceManager.serviceTrace(session.getShardingService(), "execute-in-exists-connection");
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public MultiNodeDdlPrepareHandler(NonBlockingSession session, RouteResultset rrs
this.traceMessage = "execute-for-ddl-prepare";
}

@Override
protected boolean isMustWrite() {
return true;
}

@Override
protected void innerExecute(BackendConnection conn, RouteResultsetNode node) {
if (clearIfSessionClosed()) return;
Expand Down

0 comments on commit 2355524

Please sign in to comment.