github-actions[bot] commented on code in PR #62721:
URL: https://github.com/apache/doris/pull/62721#discussion_r3124566499
##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -430,6 +430,10 @@ public void setPlanner(Planner planner) {
}
public boolean isForwardToMaster() {
+ // point-query currently never forward to the master
+ if (statementContext.isShortCircuitQuery()) {
Review Comment:
`statementContext.isShortCircuitQuery()` is a sticky flag copied from
`COM_STMT_PREPARE`. On the first `COM_STMT_EXECUTE`, or after
`preparedStmtCtx.shortCircuitQueryContext` is invalidated by schema change,
`ExecuteCommand.run()` falls back to `executor.execute()` and still needs the
normal `!canRead()` forward-to-master safety check. Returning `false` here
suppresses that replan-time forward decision and can execute a prepared point
query against stale follower metadata during master switch, for example after
the table is altered or dropped on the master. Please key this off the actual
short-circuit execution path, not the prepare-time flag.
##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -430,6 +430,10 @@ public void setPlanner(Planner planner) {
}
public boolean isForwardToMaster() {
+ // point-query currently never forward to the master
Review Comment:
This also does not fix the underlying `finalizeCommand()` bug for other
local command wrappers that call `setParsedStmt()` with an inner query, such as
`ExplainCommand.run()`. In that path `masterOpExecutor` is still `null`, but a
later `isForwardToMaster()` re-evaluation can return `true` from the rewritten
`parsedStmt`, and `finalizeCommand()` will skip the final EOF/OK packet again.
The forwarding decision needs to reflect whether this executor actually
forwarded, not whether the current `parsedStmt` happens to look like a query.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]