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

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

                Author: ASF GitHub Bot
            Created on: 08/Jan/21 14:23
            Start Date: 08/Jan/21 14:23
    Worklog Time Spent: 10m 
      Work Description: pvargacl commented on a change in pull request #1839:
URL: https://github.com/apache/hive/pull/1839#discussion_r553971662



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -1006,16 +1007,23 @@ public boolean checkFailedCompactions(CompactionInfo 
ci) throws MetaException {
         rs = pStmt.executeQuery();
         int numFailed = 0;
         int numTotal = 0;
+        long lastEnqueueTime = -1;
         int failedThreshold = MetastoreConf.getIntVar(conf, 
ConfVars.COMPACTOR_INITIATOR_FAILED_THRESHOLD);
         while(rs.next() && ++numTotal <= failedThreshold) {
+          long enqueueTime = rs.getLong(2);
+          if (enqueueTime > lastEnqueueTime) {
+            lastEnqueueTime = enqueueTime;
+          }
           if(rs.getString(1).charAt(0) == FAILED_STATE) {
             numFailed++;
           }
           else {
             numFailed--;
           }
         }
-        return numFailed == failedThreshold;
+        // If the last attempt was too long ago, ignore the failed treshold 
and try compaction again
+        long retryTime = MetastoreConf.getTimeVar(conf, 
ConfVars.COMPACTOR_INITIATOR_FAILED_RETRY_TIME, TimeUnit.MILLISECONDS);

Review comment:
       Still, this does not initiate anything in the conf, it is already there 
in memory. Just run some test on my machine the average time for a getTimeVar 
call is 0.48 microsecond




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 533038)
    Time Spent: 1.5h  (was: 1h 20m)

> Retry compaction after configured time
> --------------------------------------
>
>                 Key: HIVE-24602
>                 URL: https://issues.apache.org/jira/browse/HIVE-24602
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Peter Varga
>            Assignee: Peter Varga
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Currently if compaction fails two consecutive times it will stop compaction 
> forever for the given partition / table unless someone manually intervenes. 
> See COMPACTOR_INITIATOR_FAILED_THRESHOLD.
> The Initiator should retry again after a configurable amount of time.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to