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

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

                Author: ASF GitHub Bot
            Created on: 19/Oct/21 08:40
            Start Date: 19/Oct/21 08:40
    Worklog Time Spent: 10m 
      Work Description: deniskuzZ commented on a change in pull request #2716:
URL: https://github.com/apache/hive/pull/2716#discussion_r731628641



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -529,19 +531,22 @@ public void cleanTxnToWriteIdTable() throws MetaException 
{
         // If there are no txns which are currently open or aborted in the 
system, then current value of
         // max(TXNS.txn_id) could be min_uncommitted_txnid.
         String s = "SELECT MIN(\"RES\".\"ID\") AS \"ID\" FROM (" +
-            "SELECT MAX(\"TXN_ID\") + 1 AS \"ID\" FROM \"TXNS\" " +
-            "UNION " +
-            "SELECT MIN(\"WS_COMMIT_ID\") AS \"ID\" FROM \"WRITE_SET\" " +
-            "UNION " +
-            "SELECT MIN(\"TXN_ID\") AS \"ID\" FROM \"TXNS\" WHERE 
\"TXN_STATE\" = " + TxnStatus.ABORTED +
-            " OR \"TXN_STATE\" = " + TxnStatus.OPEN +
-            ") \"RES\"";
+          " SELECT MAX(\"TXN_ID\") + 1 AS \"ID\" FROM \"TXNS\"" +
+          (useMinHistoryLevel ? "" :
+          "   UNION" +
+          " SELECT MIN(\"WS_TXNID\") AS \"ID\" FROM \"WRITE_SET\"") +

Review comment:
       i can change, but for me original version is more readable




-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 666790)
    Time Spent: 12h 20m  (was: 12h 10m)

> cleanTxnToWriteIdTable breaks SNAPSHOT isolation
> ------------------------------------------------
>
>                 Key: HIVE-25346
>                 URL: https://issues.apache.org/jira/browse/HIVE-25346
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Zoltan Chovan
>            Assignee: Denys Kuzmenko
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 12h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to