From 5a977956667b4616b77717f320d0aa65634b1aaf Mon Sep 17 00:00:00 2001 From: 924060929 <924060929@qq.com> Date: Mon, 14 Oct 2024 17:57:28 +0800 Subject: [PATCH] fix --- .../doris/qe/runtime/ChildrenRuntimeTasks.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/runtime/ChildrenRuntimeTasks.java b/fe/fe-core/src/main/java/org/apache/doris/qe/runtime/ChildrenRuntimeTasks.java index 88103086e58f093..53bbe4680a34a71 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/runtime/ChildrenRuntimeTasks.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/runtime/ChildrenRuntimeTasks.java @@ -26,21 +26,25 @@ import java.util.Map; public class ChildrenRuntimeTasks> { - private final Map childrenTasks = Maps.newConcurrentMap(); + // LinkedHashMap: make sure the key set order is same as the input map + // so that we can the runtime filter merge backend first + private final Map childrenTasks = Maps.newLinkedHashMap(); public ChildrenRuntimeTasks(Map childrenTasks) { - this.childrenTasks.putAll(childrenTasks); + synchronized (this) { + this.childrenTasks.putAll(childrenTasks); + } } - public C get(Id id) { + public synchronized C get(Id id) { return childrenTasks.get(id); } - public List allTasks() { + public synchronized List allTasks() { return Utils.fastToImmutableList(childrenTasks.values()); } - public Map allTaskMap() { + public synchronized Map allTaskMap() { return ImmutableMap.copyOf(childrenTasks); } }