github-actions[bot] commented on code in PR #62721:
URL: https://github.com/apache/doris/pull/62721#discussion_r3125192357


##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -475,6 +475,16 @@ public ByteBuffer getOutputPacket() {
         }
     }
 
+    /**
+     * Whether this executor has actually forwarded to master and created a 
{@link MasterOpExecutor}.
+     *
+     * <p>Do not confuse with {@link #isForwardToMaster()} which is a decision 
(may be re-evaluated)
+     * based on current statement shape / redirect status.
+     */
+    public boolean hasForwardedToMaster() {

Review Comment:
   `finalizeCommand()` now keys off actual forwarding, but 
`ConnectProcessor.handleQuery()` and `AuditLogHelper` still consume 
`isForwardToMaster()` after execution. That is a distinct failure mode from the 
already-known packet-loss bug: on a follower that currently cannot read, a 
local wrapper such as `EXPLAIN SELECT ...; SELECT 1` rewrites `parsedStmt` to 
the inner query, so `isForwardToMaster()` becomes true even though 
`masterOpExecutor` is still null. `handleQuery()` then sees 
`getProxyStatusCode()==UNKNOWN` and breaks before executing the second 
statement, and audit logs also record a bogus proxy state. Please switch those 
post-execution call sites to `hasForwardedToMaster()` as well.



-- 
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]

Reply via email to