[
https://issues.apache.org/jira/browse/HIVE-25943?focusedWorklogId=730731&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-730731
]
ASF GitHub Bot logged work on HIVE-25943:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Feb/22 09:48
Start Date: 22/Feb/22 09:48
Worklog Time Spent: 10m
Work Description: deniskuzZ commented on a change in pull request #3034:
URL: https://github.com/apache/hive/pull/3034#discussion_r811758585
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -1430,6 +1428,44 @@ public void markRefused(CompactionInfo info) throws
MetaException {
updateStatus(info);
}
+
+ @Override
+ @RetrySemantics.CannotRetry
+ public void updateCompactionRetry(CompactionInfo info, long retentionTime)
throws MetaException {
+ try {
+ Connection dbConn = null;
+ PreparedStatement stmt = null;
+ try {
+ dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
+ stmt = dbConn.prepareStatement("UPDATE \"COMPACTION_QUEUE\" SET
\"CQ_TBLPROPERTIES\" = ?, CQ_COMMIT_TIME = ? "
+ + " WHERE \"CQ_ID\" = ?");
+ stmt.setString(1, info.properties);
+ stmt.setLong(2, retentionTime);
+ stmt.setLong(3, info.id);
+ int updCnt = stmt.executeUpdate();
+ if (updCnt != 1) {
+ LOG.error("Unable to update compaction queue record: " + info + ".
updCnt=" + updCnt);
+ LOG.debug("Going to rollback");
+ dbConn.rollback();
+ }
+ LOG.debug("Going to commit");
+ dbConn.commit();
+ } catch (SQLException e) {
+ LOG.error("Unable to update compaction queue " + e.getMessage());
+ LOG.debug("Going to rollback");
+ rollbackDBConn(dbConn);
+ checkRetryable(e, "markCompacted(" + info + ")");
+ throw new MetaException("Unable to connect to transaction database " +
+ StringUtils.stringifyException(e));
+ } finally {
+ closeStmt(stmt);
Review comment:
use try-with-resources instead of manually closing them
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 730731)
Time Spent: 1h 40m (was: 1.5h)
> Introduce compaction cleaner failed attempts threshold
> ------------------------------------------------------
>
> Key: HIVE-25943
> URL: https://issues.apache.org/jira/browse/HIVE-25943
> Project: Hive
> Issue Type: Improvement
> Components: Hive
> Reporter: László Végh
> Assignee: László Végh
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> If the cleaner fails for some reason, the compaction entity status remains in
> "ready for cleaning", therefore the cleaner will pick up this entity
> resulting in an endless try. The number of failed cleaning attempts should be
> counted and if they reach a certain threshold the cleaner must skip all the
> cleaning attempts on that compaction entity.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)