deniskuzZ commented on code in PR #4091:
URL: https://github.com/apache/hive/pull/4091#discussion_r1161670816
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java:
##########
@@ -702,6 +699,102 @@ public void markCleaned(CompactionInfo info) throws
MetaException {
}
}
+ @Override
+ public void markCleanedForAborts(AcidTxnInfo info) throws MetaException {
+ // Do cleanup of TXN_COMPONENTS table
+ LOG.debug("Running markCleanedForAborts with CompactionInfo: {}", info);
+ try {
+ Connection dbConn = null;
+ try {
+ dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED,
connPoolCompaction);
+ markAbortCleaned(dbConn, info);
+ LOG.debug("Going to commit");
+ dbConn.commit();
+ } catch (SQLException e) {
+ LOG.error("Unable to delete from txn components due to {}",
e.getMessage());
+ LOG.debug("Going to rollback");
+ rollbackDBConn(dbConn);
+ checkRetryable(e, "markCleanedForAborts(" + info + ")");
+ throw new MetaException("Unable to connect to transaction database " +
+ e.getMessage());
+ } finally {
+ closeDbConn(dbConn);
+ }
+ } catch (RetryException e) {
+ markCleanedForAborts(info);
+ }
+ }
+
+ private void markAbortCleaned(Connection dbConn, AcidTxnInfo info) throws
MetaException, RetryException {
Review Comment:
rename to `removeTxnComponents`
--
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]