[ 
https://issues.apache.org/jira/browse/HIVE-11495?focusedWorklogId=838019&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-838019
 ]

ASF GitHub Bot logged work on HIVE-11495:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Jan/23 16:27
            Start Date: 09/Jan/23 16:27
    Worklog Time Spent: 10m 
      Work Description: SourabhBadhya commented on code in PR #3908:
URL: https://github.com/apache/hive/pull/3908#discussion_r1064833234


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -5150,6 +5166,7 @@ private int abortTxns(Connection dbConn, List<Long> 
txnids, boolean checkHeartbe
       if (MetastoreConf.getBoolVar(conf, 
MetastoreConf.ConfVars.METASTORE_ACIDMETRICS_EXT_ON)) {
         
Metrics.getOrCreateCounter(MetricsConstants.TOTAL_NUM_ABORTED_TXNS).inc(txnids.size());
       }
+      LOG.warn("Txns are aborted successfully due to : {}. Aborted Transaction 
IDs : {}", errorMsg, txnids);

Review Comment:
   Used this format of logging as suggested - 
   `LOG.info("Aborted transactions {} due to {}", txnids, errorMsg);`
   
   Updated the error msgs to make it concise in TxnErrorMsg.



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -5094,12 +5109,13 @@ private int abortTxns(Connection dbConn, List<Long> 
txnids,
    * @throws SQLException
    */
   private int abortTxns(Connection dbConn, List<Long> txnids, boolean 
checkHeartbeat,
-                        boolean skipCount, boolean isReplReplayed)
+                        boolean skipCount, boolean isReplReplayed, TxnErrorMsg 
errorMsg)
       throws SQLException, MetaException {
     Statement stmt = null;
     if (txnids.isEmpty()) {
       return 0;
     }
+    LOG.debug("Trying to abort txns due to : {}. Aborted Transaction IDs : 
{}", errorMsg, txnids);

Review Comment:
   Implemented as suggested.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 838019)
    Time Spent: 14h 10m  (was: 14h)

> Add aborted reason to transaction information.
> ----------------------------------------------
>
>                 Key: HIVE-11495
>                 URL: https://issues.apache.org/jira/browse/HIVE-11495
>             Project: Hive
>          Issue Type: Improvement
>          Components: Metastore, Transactions
>    Affects Versions: 1.0.0
>            Reporter: Eugene Koifman
>            Assignee: Sourabh Badhya
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 14h 10m
>  Remaining Estimate: 0h
>
> Add logging messages mentioning the reason to abort the transaction.
> Another reason: Commit can fail due to a conflicting write from another txn 
> (since HIVE-13395)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to