[ 
https://issues.apache.org/jira/browse/HIVE-26384?focusedWorklogId=789971&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-789971
 ]

ASF GitHub Bot logged work on HIVE-26384:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Jul/22 10:36
            Start Date: 12/Jul/22 10:36
    Worklog Time Spent: 10m 
      Work Description: deniskuzZ commented on code in PR #3428:
URL: https://github.com/apache/hive/pull/3428#discussion_r918814791


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java:
##########
@@ -674,7 +674,9 @@ void wasSuccessful() {
     @Override public void close() throws Exception {
       try {
         //the transaction is about to close, we can stop heartbeating 
regardless of it's state
-        CompactionHeartbeatService.getInstance(conf).stopHeartbeat(txnId);
+        if (txnId > 0) {

Review Comment:
   I think we should simply move the following check at the beginning of the 
close() method  
   ````
         if (status == TxnStatus.UNKNOWN) {
           return;
         }
   ````





Issue Time Tracking
-------------------

    Worklog Id:     (was: 789971)
    Time Spent: 0.5h  (was: 20m)

> Compactor worker should not stop heartbeat for TXN 0
> ----------------------------------------------------
>
>                 Key: HIVE-26384
>                 URL: https://issues.apache.org/jira/browse/HIVE-26384
>             Project: Hive
>          Issue Type: Bug
>          Components: Transactions
>            Reporter: Yu-Wen Lai
>            Assignee: Yu-Wen Lai
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When there is no compaction to execute, the worker still calls stopHeartbeat 
> and it throws a IllegalStateException as below.
> {code:java}
> 2022-07-01T10:18:55,273 ERROR 
> [impala-ec2-centos74-m5-4xlarge-ondemand-09b3.vpc.cloudera.com-44_executor] 
> compactor.Worker: Caught an exception in the main loop of compactor worker 
> impala-ec2-centos74-m5-4xlarge-ondemand-09b3.vpc.cloudera.com-44, 
> java.lang.IllegalStateException: No registered heartbeat found for TXN 0
>         at 
> org.apache.hadoop.hive.ql.txn.compactor.CompactionHeartbeatService.stopHeartbeat(CompactionHeartbeatService.java:108)
>         at 
> org.apache.hadoop.hive.ql.txn.compactor.Worker$CompactionTxn.close(Worker.java:692)
>         at 
> org.apache.hadoop.hive.ql.txn.compactor.Worker.findNextCompactionAndExecute(Worker.java:516)
>         at 
> org.apache.hadoop.hive.ql.txn.compactor.Worker.lambda$run$0(Worker.java:115)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at java.lang.Thread.run(Thread.java:748)
>  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to