924060929 commented on code in PR #68283:
URL: https://github.com/apache/doris/pull/68283#discussion_r4059056881


##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -1358,6 +1362,7 @@ public boolean isProfileSafeStmt() {
 
     private void forwardToMaster() throws Exception {
         masterOpExecutor = new MasterOpExecutor(originStmt, context, 
redirectStatus, isQuery());
+        throwIfTerminated();

Review Comment:
   Fixed in 0bb0b7339b1. The origin-side MasterOpExecutor now makes 
cancel-versus-start a synchronized handoff and retains the original terminal 
reason. On the master, ProxyQueryRegistry keeps a bounded pending-cancel 
tombstone until the query context registers, and ConnectContext replays it 
again when the StmtExecutor is published. The new test covers 
cancel-before-registration followed by late executor publication.



##########
fe/fe-core/src/main/java/org/apache/doris/qe/PointQueryExecutor.java:
##########
@@ -254,12 +255,16 @@ void addKeyTuples(
 
     @Override
     public void cancel(Status cancelReason) {
-        // Do nothing
+        this.cancelReason = cancelReason;
+        isCancel = true;
     }
 
 
     @Override
     public RowBatch getNext() throws Exception {
+        if (isCancel) {

Review Comment:
   Fixed in 0bb0b7339b1. PointQueryExecutor retains the first terminal reason, 
publishes and cancels the active lookup Future, handles CancellationException, 
and fences cancellation before retries and before returning completed/empty 
results. Added a barrier-controlled in-flight completion test plus 
active-future cancellation coverage.



##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -220,7 +221,7 @@ public class StmtExecutor {
     // the idle reaper's bound and the profile's times counted from its own 
start.
     private volatile TUniqueId deferredQueryId;
     private volatile long deferredStartTimeMs = -1;
-    private MasterOpExecutor masterOpExecutor = null;
+    private volatile MasterOpExecutor masterOpExecutor = null;

Review Comment:
   Fixed in 0bb0b7339b1. Cancellation now uses a local TMasterOpResult returned 
by forwardCancel(); only statement execution writes FEOpExecutor.result. The 
overlap test holds the cancel reply until after the statement reply and 
verifies the statement status remains intact.



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