[ https://issues.apache.org/jira/browse/HIVE-25898?focusedWorklogId=718576&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-718576 ]
ASF GitHub Bot logged work on HIVE-25898: ----------------------------------------- Author: ASF GitHub Bot Created on: 01/Feb/22 11:22 Start Date: 01/Feb/22 11:22 Worklog Time Spent: 10m Work Description: deniskuzZ commented on a change in pull request #2981: URL: https://github.com/apache/hive/pull/2981#discussion_r796497897 ########## File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/TestCompactor.java ########## @@ -170,6 +176,82 @@ public void tearDown() { } } + + @Test + public void testHeartbeatShutdownOnFailedCompaction() throws Exception { + String dbName = "default"; + String tblName = "compaction_test"; + executeStatementOnDriver("drop table if exists " + tblName, driver); + executeStatementOnDriver("CREATE TABLE " + tblName + "(a INT, b STRING) " + + " PARTITIONED BY(bkt INT)" + + " CLUSTERED BY(a) INTO 4 BUCKETS" + //currently ACID requires table to be bucketed + " STORED AS ORC TBLPROPERTIES ('transactional'='true')", driver); + + StrictDelimitedInputWriter writer = StrictDelimitedInputWriter.newBuilder() + .withFieldDelimiter(',') + .build(); + HiveStreamingConnection connection = HiveStreamingConnection.newBuilder() + .withDatabase(dbName) + .withTable(tblName) + .withStaticPartitionValues(Arrays.asList("0")) + .withAgentInfo("UT_" + Thread.currentThread().getName()) + .withHiveConf(conf) + .withRecordWriter(writer) + .connect(); + connection.beginTransaction(); + connection.write("55, 'London'".getBytes()); + connection.commitTransaction(); + connection.beginTransaction(); + connection.write("56, 'Paris'".getBytes()); + connection.commitTransaction(); + connection.close(); + + executeStatementOnDriver("INSERT INTO TABLE " + tblName + " PARTITION(bkt=1)" + + " values(57, 'Budapest')", driver); + executeStatementOnDriver("INSERT INTO TABLE " + tblName + " PARTITION(bkt=1)" + + " values(58, 'Milano')", driver); + execSelectAndDumpData("select * from " + tblName, driver, "Dumping data for " + + tblName + " after load:"); + + TxnStore txnHandler = TxnUtils.getTxnStore(conf); + + // Commit will throw an exception + final IMetaStoreClient mockedClient = Mockito.spy(HiveMetaStoreUtils.getHiveMetastoreClient(conf)); Review comment: use ```` final IMetaStoreClient mockedClient = Mockito.spy(new HiveMetaStoreClient(conf)); ```` and remove MockMaker -- 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-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 718576) Time Spent: 0.5h (was: 20m) > Compaction txn heartbeating after Worker timeout > ------------------------------------------------ > > Key: HIVE-25898 > URL: https://issues.apache.org/jira/browse/HIVE-25898 > Project: Hive > Issue Type: Bug > Components: Hive > Reporter: László Végh > Assignee: László Végh > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > In some cases, when the compaction transaction is aborted, the hearbeater > thread is not shut down and keeps heartbeating. -- This message was sent by Atlassian Jira (v8.20.1#820001)