From d554d5478c8d70713bc0883a98aef76ef4809726 Mon Sep 17 00:00:00 2001 From: yiguolei <676222867@qq.com> Date: Thu, 18 Jan 2024 10:00:53 +0800 Subject: [PATCH] [improvement](fe) skip attach profile during send fragment (#30085) Sometime attach profile may cost a lot of time in large machine with many instances. --------- Co-authored-by: yiguolei --- .../main/java/org/apache/doris/qe/Coordinator.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 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 2f58e56074..586a27ee10 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 @@ -233,7 +233,6 @@ public class Coordinator implements CoordInterface { // Input parameter private long jobId = -1; // job which this task belongs to private TUniqueId queryId; - private final boolean needReport; // parallel execute private final TUniqueId nextInstanceId; @@ -324,7 +323,6 @@ public class Coordinator implements CoordInterface { } else { this.queryGlobals.setTimeZone(context.getSessionVariable().getTimeZone()); } - this.needReport = context.getSessionVariable().enableProfile(); this.nextInstanceId = new TUniqueId(); nextInstanceId.setHi(queryId.hi); nextInstanceId.setLo(queryId.lo + 1); @@ -348,7 +346,6 @@ public class Coordinator implements CoordInterface { this.queryGlobals.setTimeZone(timezone); this.queryGlobals.setLoadZeroTolerance(loadZeroTolerance); this.queryOptions.setBeExecVersion(Config.be_exec_version); - this.needReport = true; this.nextInstanceId = new TUniqueId(); nextInstanceId.setHi(queryId.hi); nextInstanceId.setLo(queryId.lo + 1); @@ -845,8 +842,9 @@ public class Coordinator implements CoordInterface { } waitRpc(futures, this.timeoutDeadline - System.currentTimeMillis(), "send execution start"); } - - attachInstanceProfileToFragmentProfile(); + if (context != null && context.getSessionVariable().enableProfile()) { + attachInstanceProfileToFragmentProfile(); + } } finally { unlock(); } @@ -988,8 +986,9 @@ public class Coordinator implements CoordInterface { } waitPipelineRpc(futures, this.timeoutDeadline - System.currentTimeMillis(), "send execution start"); } - - attachInstanceProfileToFragmentProfile(); + if (context != null && context.getSessionVariable().enableProfile()) { + attachInstanceProfileToFragmentProfile(); + } } finally { unlock(); }