From 1818526fba8937aeea9705445b2f182ce68d818a Mon Sep 17 00:00:00 2001 From: zclllyybb Date: Wed, 19 Jul 2023 10:00:48 +0800 Subject: [PATCH] [fix](profile) Fix wrong instance number in query profile (#21808) --- .../java/org/apache/doris/qe/Coordinator.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 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 5ccbbcaa1e..7f0abff227 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 @@ -478,7 +478,8 @@ public class Coordinator { Map result = Maps.newTreeMap(); if (enablePipelineEngine) { for (PipelineExecContexts ctxs : beToPipelineExecCtxs.values()) { - result.put(ctxs.brpcAddr.hostname.concat(":").concat("" + ctxs.brpcAddr.port), ctxs.ctxs.size()); + result.put(ctxs.brpcAddr.hostname.concat(":").concat("" + ctxs.brpcAddr.port), + ctxs.getInstanceNumber()); } } else { for (BackendExecStates states : beToExecStates.values()) { @@ -842,7 +843,8 @@ public class Coordinator { PipelineExecContexts ctxs = beToPipelineExecCtxs.get(pipelineExecContext.backend.getId()); if (ctxs == null) { ctxs = new PipelineExecContexts(pipelineExecContext.backend.getId(), - pipelineExecContext.brpcAddress, twoPhaseExecution); + pipelineExecContext.brpcAddress, twoPhaseExecution, + entry.getValue().getFragmentNumOnHost()); beToPipelineExecCtxs.putIfAbsent(pipelineExecContext.backend.getId(), ctxs); } ctxs.addContext(pipelineExecContext); @@ -2996,17 +2998,24 @@ public class Coordinator { List ctxs = Lists.newArrayList(); boolean twoPhaseExecution = false; ScopedSpan scopedSpan = new ScopedSpan(); + int instanceNumber; - public PipelineExecContexts(long beId, TNetworkAddress brpcAddr, boolean twoPhaseExecution) { + public PipelineExecContexts(long beId, TNetworkAddress brpcAddr, boolean twoPhaseExecution, + int instanceNumber) { this.beId = beId; this.brpcAddr = brpcAddr; this.twoPhaseExecution = twoPhaseExecution; + this.instanceNumber = instanceNumber; } public void addContext(PipelineExecContext ctx) { this.ctxs.add(ctx); } + public int getInstanceNumber() { + return instanceNumber; + } + /** * The BackendExecState in states are all send to the same BE. * So only the first BackendExecState need to carry some common fields, such as DescriptorTbl,