Return-Path: X-Original-To: apmail-hive-commits-archive@www.apache.org Delivered-To: apmail-hive-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 40A1D18CA2 for ; Tue, 14 Jul 2015 17:49:35 +0000 (UTC) Received: (qmail 29144 invoked by uid 500); 14 Jul 2015 17:49:35 -0000 Delivered-To: apmail-hive-commits-archive@hive.apache.org Received: (qmail 29102 invoked by uid 500); 14 Jul 2015 17:49:35 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 29091 invoked by uid 99); 14 Jul 2015 17:49:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2015 17:49:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F38ADE03C0; Tue, 14 Jul 2015 17:49:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: thejas@apache.org To: commits@hive.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hive git commit: HIVE-11224 : AggregateStatsCache triggers java.util.ConcurrentModificationException under some conditions (Pengcheng Xiong via Thejas Nair) Date: Tue, 14 Jul 2015 17:49:34 +0000 (UTC) Repository: hive Updated Branches: refs/heads/branch-1 388685c24 -> 0c16534b3 HIVE-11224 : AggregateStatsCache triggers java.util.ConcurrentModificationException under some conditions (Pengcheng Xiong via Thejas Nair) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/0c16534b Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/0c16534b Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/0c16534b Branch: refs/heads/branch-1 Commit: 0c16534b3fb7f7126c23a8869d039f665c27b8fe Parents: 388685c Author: Pengcheng Xiong Authored: Tue Jul 14 10:46:30 2015 -0700 Committer: Thejas Nair Committed: Tue Jul 14 10:49:28 2015 -0700 ---------------------------------------------------------------------- .../org/apache/hadoop/hive/metastore/AggregateStatsCache.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/0c16534b/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java b/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java index 44106f5..65e2c65 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/AggregateStatsCache.java @@ -241,7 +241,8 @@ public class AggregateStatsCache { // We'll count misses as we iterate int maxMisses = (int) maxVariance * numPartsRequested; for (String partName : partNames) { - for (Map.Entry entry : candidateMatchStats.entrySet()) { + for (Iterator> iterator = candidateMatchStats.entrySet().iterator(); iterator.hasNext();) { + Map.Entry entry = iterator.next(); AggrColStats candidate = entry.getKey(); matchStats = entry.getValue(); if (candidate.getBloomFilter().test(partName.getBytes())) { @@ -252,7 +253,7 @@ public class AggregateStatsCache { // 2nd pass at removing invalid candidates // If misses so far exceed max tolerable misses if (matchStats.misses > maxMisses) { - candidateMatchStats.remove(candidate); + iterator.remove(); continue; } // Check if this is the best match so far