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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]