You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/02/03 13:43:01 UTC
[doris] branch master updated: [Fix](point query) OlapScanNode `reuslt` could be memleak since it's cached (#16406)
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 54c85e36ad [Fix](point query) OlapScanNode `reuslt` could be memleak since it's cached (#16406)
54c85e36ad is described below
commit 54c85e36adae1e60a3ca3eca630a9eef051d09bb
Author: lihangyu <15...@163.com>
AuthorDate: Fri Feb 3 21:42:53 2023 +0800
[Fix](point query) OlapScanNode `reuslt` could be memleak since it's cached (#16406)
Cached OlapScanNode each time call `addScanRangeLocations` will add TScanRangeLocations to result.
So `result` could grow too large and lead `getReplicaNumPerHost` a cpu hot spot in it's loop.
---
.../org/apache/doris/planner/OlapScanNode.java | 1 +
.../main/java/org/apache/doris/qe/Coordinator.java | 23 +++++++++++-----------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java
index 5b46ed7b42..f30b76b9bf 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java
@@ -978,6 +978,7 @@ public class OlapScanNode extends ScanNode {
computePartitionInfo();
scanBackendIds.clear();
scanTabletIds.clear();
+ result.clear();
try {
getScanRangeLocations();
} catch (AnalysisException e) {
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 d284ce999a..e90b38df4e 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
@@ -1615,24 +1615,23 @@ public class Coordinator {
// Populates scan_range_assignment_.
// <fragment, <server, nodeId>>
private void computeScanRangeAssignment() throws Exception {
+ if (isPointQuery) {
+ // Fast path for evaluate Backend for point query
+ List<TScanRangeLocations> locations = ((OlapScanNode) scanNodes.get(0)).lazyEvaluateRangeLocations();
+ Preconditions.checkNotNull(locations);
+ return;
+ }
Map<TNetworkAddress, Long> assignedBytesPerHost = Maps.newHashMap();
Map<TNetworkAddress, Long> replicaNumPerHost = getReplicaNumPerHost();
Collections.shuffle(scanNodes);
// set scan ranges/locations for scan nodes
for (ScanNode scanNode : scanNodes) {
List<TScanRangeLocations> locations;
- if (isPointQuery) {
- // Fast path for evaluate Backend for point query
- locations = ((OlapScanNode) scanNode).lazyEvaluateRangeLocations();
- Preconditions.checkNotNull(locations);
- return;
- } else {
- // the parameters of getScanRangeLocations may ignore, It doesn't take effect
- locations = scanNode.getScanRangeLocations(0);
- if (locations == null) {
- // only analysis olap scan node
- continue;
- }
+ // the parameters of getScanRangeLocations may ignore, It doesn't take effect
+ locations = scanNode.getScanRangeLocations(0);
+ if (locations == null) {
+ // only analysis olap scan node
+ continue;
}
Collections.shuffle(locations);
Set<Integer> scanNodeIds = fragmentIdToScanNodeIds.computeIfAbsent(scanNode.getFragmentId(),
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org