You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2023/01/09 10:51:50 UTC
[GitHub] [hive] rkirtir commented on a diff in pull request #3864: HIVE-26825 : Compactor: Cleaner shouldn't fetch table details again a…
rkirtir commented on code in PR #3864:
URL: https://github.com/apache/hive/pull/3864#discussion_r1064505432
##########
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCleaner.java:
##########
@@ -1093,5 +1095,34 @@ public void testReady() throws Exception {
Assert.assertEquals(TxnStore.CLEANING_RESPONSE, rsp.getCompacts().get(0).getState());
}
+ @Test
+ public void testMetaCache() throws Exception {
+ conf.setBoolVar(HIVE_COMPACTOR_DELAYED_CLEANUP_ENABLED, false);
+
+ Table t = newTable("default", "retry_test", false);
+
+ addBaseFile(t, null, 20L, 20);
+ addDeltaFile(t, null, 21L, 22L, 2);
+ addDeltaFile(t, null, 23L, 24L, 2);
+ burnThroughTransactions("default", "retry_test", 25);
+
+ CompactionRequest rqst = new CompactionRequest("default", "retry_test", CompactionType.MAJOR);
+ long compactTxn = compactInTxn(rqst);
+ addBaseFile(t, null, 25L, 25, compactTxn);
+
+ //Prevent cleaner from marking the compaction as cleaned
+ TxnStore mockedHandler = spy(txnHandler);
+ doThrow(new RuntimeException()).when(mockedHandler).markCleaned(nullable(CompactionInfo.class));
+ Cleaner cleaner = Mockito.spy(new Cleaner());
+ cleaner.setConf(conf);
+ cleaner.init(new AtomicBoolean(true));
+ cleaner.run();
+
+ ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
+ List<ShowCompactResponseElement> compacts = rsp.getCompacts();
+ Assert.assertEquals(1, compacts.size());
+ Mockito.verify(cleaner, times(1)).resolveTable(Mockito.any());
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org