This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 994c5c6f6e2 [chore](log) Add log to trace query cancel #28020
994c5c6f6e2 is described below

commit 994c5c6f6e2883d6a8d509782e5f66513617a775
Author: zhiqiang <seuhezhiqi...@163.com>
AuthorDate: Wed Dec 6 15:51:21 2023 +0800

    [chore](log) Add log to trace query cancel #28020
---
 .../main/java/org/apache/doris/qe/Coordinator.java | 46 +++++++++++-----------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
index 30a746d36e8..c08c7daf0b8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
@@ -622,10 +622,9 @@ public class Coordinator implements CoordInterface {
                 context.setResultInternalServiceAddr(toBrpcHost(execBeAddr));
                 
context.setResultOutputExprs(fragments.get(0).getOutputExprs());
             }
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("dispatch result sink of query {} to {}", 
DebugUtil.printId(queryId),
-                        topParams.instanceExecParams.get(0).host);
-            }
+
+            LOG.info("dispatch result sink of query {} to {}", 
DebugUtil.printId(queryId),
+                    topParams.instanceExecParams.get(0).host);
 
             if (topDataSink instanceof ResultFileSink
                     && ((ResultFileSink) topDataSink).getStorageType() == 
StorageBackend.StorageType.BROKER) {
@@ -2540,12 +2539,19 @@ public class Coordinator implements CoordInterface {
             // for now, abort the query if we see any error except if the 
error is cancelled
             // and returned_all_results_ is true.
             // (UpdateStatus() initiates cancellation, if it hasn't already 
been initiated)
-            if (!(returnedAllResults && status.isCancelled()) && !status.ok()) 
{
-                LOG.warn("one instance report fail, query_id={} 
instance_id={}, error message: {}",
-                        DebugUtil.printId(queryId), 
DebugUtil.printId(params.getFragmentInstanceId()),
-                        status.getErrorMsg());
-                updateStatus(status, params.getFragmentInstanceId());
+            if (!status.ok()) {
+                if (status.isCancelled() && returnedAllResults) {
+                    LOG.warn("Query {} has returned all results, its instance 
{} is reporting failed status {}",
+                            DebugUtil.printId(queryId), 
DebugUtil.printId(params.getFragmentInstanceId()),
+                            status.getErrorMsg());
+                } else {
+                    LOG.warn("Instance {} of query {} report failed status, 
error msg: {}",
+                            DebugUtil.printId(queryId), 
DebugUtil.printId(params.getFragmentInstanceId()),
+                            status.getErrorMsg());
+                    updateStatus(status, params.getFragmentInstanceId());
+                }
             }
+
             if (execState.done) {
                 if (params.isSetDeltaUrls()) {
                     updateDeltas(params.getDeltaUrls());
@@ -2968,12 +2974,10 @@ public class Coordinator implements CoordInterface {
         // cancel the fragment instance.
         // return true if cancel success. Otherwise, return false
         public synchronized boolean 
cancelFragmentInstance(Types.PPlanFragmentCancelReason cancelReason) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("cancelRemoteFragments initiated={} done={} 
hasCanceled={} backend: {},"
-                                + " fragment instance id={}, reason: {}",
-                        this.initiated, this.done, this.hasCanceled, 
backend.getId(),
-                        DebugUtil.printId(fragmentInstanceId()), 
cancelReason.name());
-            }
+            LOG.warn("cancelRemoteFragments initiated={} done={} 
hasCanceled={} backend: {},"
+                            + " fragment instance id={}, reason: {}",
+                    this.initiated, this.done, this.hasCanceled, 
backend.getId(),
+                    DebugUtil.printId(fragmentInstanceId()), 
cancelReason.name());
             try {
                 if (!this.initiated) {
                     return false;
@@ -3160,13 +3164,11 @@ public class Coordinator implements CoordInterface {
                 return false;
             }
             for (TPipelineInstanceParams localParam : rpcParams.local_params) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("cancelRemoteFragments initiated={} done={} 
hasCanceled={} backend: {},"
-                                    + " fragment instance id={} query={}, 
reason: {}",
-                            this.initiated, this.done, this.hasCanceled, 
backend.getId(),
-                            DebugUtil.printId(localParam.fragment_instance_id),
-                            DebugUtil.printId(queryId), cancelReason.name());
-                }
+                LOG.warn("cancelRemoteFragments initiated={} done={} 
hasCanceled={} backend:{},"
+                                + " fragment instance id={} query={}, reason: 
{}",
+                        this.initiated, this.done, this.hasCanceled, 
backend.getId(),
+                        DebugUtil.printId(localParam.fragment_instance_id),
+                        DebugUtil.printId(queryId), cancelReason.name());
 
                 RuntimeProfile profile = 
fragmentInstancesMap.get(localParam.fragment_instance_id);
                 if (profile.getIsDone() || profile.getIsCancel()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to