diff --git ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java index 3565616171..f26920cf43 100644 --- ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java +++ ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java @@ -228,7 +228,7 @@ public void run() { if ((ci.tableName == null && lock.getTablename() == null) || (ci.tableName != null && ci.tableName.equalsIgnoreCase(lock.getTablename()))) { if ((ci.partName == null && lock.getPartname() == null) || - (ci.partName != null && ci.partName.equals(lock.getPartname()))) { + (ci.partName != null && ci.partName.equalsIgnoreCase(lock.getPartname()))) { relatedLocks.add(lock.getLockid()); } } @@ -279,8 +279,8 @@ private void clean(CompactionInfo ci) throws MetaException { * We only want to clean up to the highestWriteId - otherwise we risk deleting deltas from * under an active reader. * - * Suppose we have deltas D2 D3 for table T, i.e. the last compaction created D3 so now there is a - * clean request for D2. + * Suppose we have deltas D2 D3 for table T, i.e. the last compaction created D3 so now there is a + * clean request for D2. * Cleaner checks existing locks and finds none. * Between that check and removeFiles() a query starts (it will be reading D3) and another compaction * completes which creates D4. diff --git ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java index ce574b4ac4..deff5de9ca 100644 --- ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java +++ ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java @@ -246,7 +246,7 @@ public void blockedByLockPartition() throws Exception { burnThroughTransactions("default", "bblp", 25); CompactionRequest rqst = new CompactionRequest("default", "bblp", CompactionType.MINOR); - rqst.setPartitionname("ds=today"); + rqst.setPartitionname("ds=Today"); txnHandler.compact(rqst); CompactionInfo ci = txnHandler.findNextToCompact("fred"); txnHandler.markCompacted(ci); @@ -254,7 +254,7 @@ public void blockedByLockPartition() throws Exception { LockComponent comp = new LockComponent(LockType.SHARED_WRITE, LockLevel.PARTITION, "default"); comp.setTablename("bblp"); - comp.setPartitionname("ds=today"); + comp.setPartitionname("ds=Today"); comp.setOperationType(DataOperationType.DELETE); List components = new ArrayList(1); components.add(comp); @@ -271,7 +271,7 @@ public void blockedByLockPartition() throws Exception { Assert.assertEquals(1, compacts.size()); Assert.assertEquals("ready for cleaning", compacts.get(0).getState()); Assert.assertEquals("bblp", compacts.get(0).getTablename()); - Assert.assertEquals("ds=today", compacts.get(0).getPartitionname()); + Assert.assertEquals("ds=Today", compacts.get(0).getPartitionname()); Assert.assertEquals(CompactionType.MINOR, compacts.get(0).getType()); }