You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2026/02/10 17:41:53 UTC
(impala) 01/02: IMPALA-14657: Use thread-safe set for droppedPartitions_
This is an automated email from the ASF dual-hosted git repository.
joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit a073dd22b3e4da451efbf6cf27d38d743d5df1d3
Author: stiga-huang <hu...@gmail.com>
AuthorDate: Tue Feb 10 16:34:44 2026 +0800
IMPALA-14657: Use thread-safe set for droppedPartitions_
droppedPartitions_ of HdfsTable keeps the partition instances that are
recently dropped but haven't been sent in the catalog updates. The set
will be cleared in the catalog update thread after these deletions are
collected. However, catalog update thread just acquires read lock on
this table. So we need a thread-safe set to avoid breaking other readers
like toMinimalTCatalogObject().
This changes droppedPartitions_ to use a thread-safe set.
Tests
- Ran TestPartitionDeletion::test_local_catalog_no_event_processing 40
times.
Change-Id: I12ff7a57c269ee387c1e41048a9e0a6679a586c3
Reviewed-on: http://gerrit.cloudera.org:8080/23957
Reviewed-by: Csaba Ringhofer <cs...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
fe/src/main/java/org/apache/impala/catalog/HdfsTable.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java b/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
index 3dc313372..3d4ef5f61 100644
--- a/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
+++ b/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
@@ -28,6 +28,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -308,7 +309,10 @@ public class HdfsTable extends Table implements FeFsTable {
// Dropped partitions since last catalog update. These partitions need to be removed
// in coordinator's cache if there are no updates on them.
- private final Set<HdfsPartition> droppedPartitions_ = new HashSet<>();
+ // This set is cleared in the catalog update thread after the deletions are collected.
+ // However, catalog update thread just acquires read lock on this table. So we need a
+ // thread-safe set to avoid breaking other readers like toMinimalTCatalogObject().
+ private final Set<HdfsPartition> droppedPartitions_ = ConcurrentHashMap.newKeySet();
// pendingVersionNumber indicates a version number allocated to this HdfsTable for a
// ongoing DDL operation. This is mainly used by the topic update thread to skip a