From 5a5750a8280bdbae1a1662b13d9f0625126c75ea 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 343d3a3ca8df88..f9404e21fa24e9 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 @@ -1272,12 +1272,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() {