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

dataroaring 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 e21d0f89f4f [fix](profile) Fix duplicated profile  (#36120)
e21d0f89f4f is described below

commit e21d0f89f4f3c9fc3f5b6e7926792e5a59d05e11
Author: zhiqiang <seuhezhiqi...@163.com>
AuthorDate: Wed Jun 12 10:48:27 2024 +0800

    [fix](profile) Fix duplicated profile  (#36120)
    
    This #35073 changed RuntimeProfile naming rules on FE, unfortunately we
    relay on the name of RuntimeProfile to eliminate the duplicated profile
    from two profile report channel...
---
 .../doris/common/profile/ExecutionProfile.java     | 22 ++++++++++++++++++----
 .../apache/doris/common/util/ProfileManager.java   |  2 +-
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/profile/ExecutionProfile.java
 
b/fe/fe-core/src/main/java/org/apache/doris/common/profile/ExecutionProfile.java
index 9c08ab343d6..3c683fced9d 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/common/profile/ExecutionProfile.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/common/profile/ExecutionProfile.java
@@ -218,9 +218,17 @@ public class ExecutionProfile {
             List<TDetailedReportParams> fragmentProfile = entry.getValue();
             int pipelineIdx = 0;
             List<RuntimeProfile> taskProfile = Lists.newArrayList();
+            // The naming rule must be same with the one in 
updateProfile(TReportExecStatusParams params)
+            // Because we relay on the name of RuntimeProfile to eliminate the 
duplicate profile
+            String suffix = " (host=" + backendHBAddress + ")";
             for (TDetailedReportParams pipelineProfile : fragmentProfile) {
-                String name = "Pipeline :" + pipelineIdx + " "
-                        + " (host=" + backendHBAddress + ")";
+                String name = "";
+                if (pipelineProfile.isSetIsFragmentLevel() && 
pipelineProfile.is_fragment_level) {
+                    name = "Fragment Level Profile: " + suffix;
+                } else {
+                    name = "Pipeline :" + pipelineIdx + " " + suffix;
+                    pipelineIdx++;
+                }
                 RuntimeProfile profileNode = new RuntimeProfile(name);
                 taskProfile.add(profileNode);
                 if (!pipelineProfile.isSetProfile()) {
@@ -261,9 +269,15 @@ public class ExecutionProfile {
         int pipelineIdx = 0;
         List<RuntimeProfile> taskProfile = Lists.newArrayList();
         String suffix = " (host=" + backend.getHeartbeatAddress() + ")";
+        // Each datailed report params is a fragment level profile or a 
pipeline profile
         for (TDetailedReportParams param : params.detailed_report) {
-            String name = param.isSetIsFragmentLevel() && 
param.is_fragment_level ? "Fragment Level Profile: "
-                    + suffix : "Pipeline :" + pipelineIdx + " " + suffix;
+            String name = "";
+            if (param.isSetIsFragmentLevel() && param.is_fragment_level) {
+                name = "Fragment Level Profile: " + suffix;
+            } else {
+                name = "Pipeline :" + pipelineIdx + " " + suffix;
+                pipelineIdx++;
+            }
             RuntimeProfile profile = new RuntimeProfile(name);
             taskProfile.add(profile);
             if (param.isSetProfile()) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java 
b/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
index 8fbcbce27cf..3609b9890cc 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java
@@ -340,7 +340,7 @@ public class ProfileManager {
         try {
             queryId = DebugUtil.parseTUniqueIdFromString(id);
         } catch (NumberFormatException e) {
-            LOG.warn("Failed to parse TUniqueId from string {} when fetch 
profile", id, e);
+            LOG.warn("Failed to parse TUniqueId from string {} when fetch 
profile", id);
         }
         List<QueryIdAndAddress> involvedBackends = Lists.newArrayList();
 


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

Reply via email to