klcopp commented on a change in pull request #1839:
URL: https://github.com/apache/hive/pull/1839#discussion_r553960649
##########
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:
I'm not 100% convinced about the time critical part, since effectively,
because of mutexing, only one Initiator thread runs on the whole system.
----------------------------------------------------------------
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]