From d8215d7a2b0a74ba7df8f07230a22be4dcec042e Mon Sep 17 00:00:00 2001 From: zhangdong Date: Fri, 22 Nov 2024 15:29:06 +0800 Subject: [PATCH] [opt](table) Remove unnecessary locks (#44416) `OlapTable`.`getPartitionIds` not need get readLock, Because it only returns the ID list without any traversal or other operations. If the caller needs to keep the partition of the table unchanged after obtaining the ID list, they should lock it themselves --- .../src/main/java/org/apache/doris/catalog/OlapTable.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java index 547a520a061e63c..ec3bd2acbc57d6b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java @@ -1385,12 +1385,7 @@ public List getEqualPartitionNames(List partitionIds1, List } public List getPartitionIds() { - readLock(); - try { - return new ArrayList<>(idToPartition.keySet()); - } finally { - readUnlock(); - } + return new ArrayList<>(idToPartition.keySet()); } public Set getCopiedBfColumns() {