deniskuzZ commented on code in PR #4384:
URL: https://github.com/apache/hive/pull/4384#discussion_r1310031152


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -6397,51 +6458,44 @@ private AbortCompactionResponseElement 
getAbortCompactionResponseElement(long co
 
   @RetrySemantics.SafeToRetry
   public AbortCompactionResponseElement abortCompaction(CompactionInfo 
compactionInfo) throws MetaException {
-    try {
-      try (Connection dbConn = 
getDbConn(Connection.TRANSACTION_READ_COMMITTED, connPoolMutex);
-           PreparedStatement pStmt = 
dbConn.prepareStatement(TxnQueries.INSERT_INTO_COMPLETED_COMPACTION)) {
-        compactionInfo.state = TxnStore.ABORTED_STATE;
-        compactionInfo.errorMessage = "Comapction Aborted by Abort Comapction 
request.";
-        CompactionInfo.insertIntoCompletedCompactions(pStmt, compactionInfo, 
getDbTime(dbConn));
-        int updCount = pStmt.executeUpdate();
-        if (updCount != 1) {
-          LOG.error("Unable to update compaction record: {}. updCnt={}", 
compactionInfo, updCount);
-          dbConn.rollback();
-          return getAbortCompactionResponseElement(compactionInfo.id, "Error",
-                  "Error while aborting compaction:Unable to update compaction 
record in COMPLETED_COMPACTIONS");
-        } else {
+    return retryHandler.executeWithRetry(new RetryCallProperties()
+            .withCallerId("abortCompaction(" + compactionInfo + ")")
+            .withDataSource(POOL_TX),
+        (DataSourceWrapper dataSourceWrapper) -> {
+          compactionInfo.state = TxnStore.ABORTED_STATE;
+          compactionInfo.errorMessage = "Comapction Aborted by Abort 
Comapction request.";

Review Comment:
   typo: Compaction



-- 
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]

Reply via email to