SourabhBadhya commented on code in PR #4313:
URL: https://github.com/apache/hive/pull/4313#discussion_r1222702113
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java:
##########
@@ -1525,39 +1651,42 @@ public void markRefused(CompactionInfo info) throws
MetaException {
updateStatus(info);
}
-
@Override
@RetrySemantics.CannotRetry
- public void setCleanerRetryRetentionTimeOnError(CompactionInfo info) throws
MetaException {
+ public void insertOrSetCleanerRetryRetentionTimeOnError(CompactionInfo info)
throws MetaException {
try {
try (Connection dbConn =
getDbConn(Connection.TRANSACTION_READ_COMMITTED, connPoolCompaction)) {
- try (PreparedStatement stmt = dbConn.prepareStatement("UPDATE
\"COMPACTION_QUEUE\" " +
- "SET \"CQ_RETRY_RETENTION\" = ?, \"CQ_ERROR_MESSAGE\"= ? WHERE
\"CQ_ID\" = ?")) {
- stmt.setLong(1, info.retryRetention);
- stmt.setString(2, info.errorMessage);
- stmt.setLong(3, info.id);
- int updCnt = stmt.executeUpdate();
- if (updCnt != 1) {
- LOG.error("Unable to update compaction queue record: {}.
updCnt={}", info, updCnt);
- dbConn.rollback();
- throw new MetaException("No record with CQ_ID=" + info.id + "
found in COMPACTION_QUEUE");
+ if (info.isAbortedTxnCleanup() && info.id == 0) {
Review Comment:
Done.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]