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

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

                Author: ASF GitHub Bot
            Created on: 06/Mar/23 15:00
            Start Date: 06/Mar/23 15:00
    Worklog Time Spent: 10m 
      Work Description: abstractdog commented on code in PR #4096:
URL: https://github.com/apache/hive/pull/4096#discussion_r1126549403


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -3647,9 +3647,12 @@ long generateCompactionQueueId(Statement stmt) throws 
SQLException, MetaExceptio
             + "no record found in next_compaction_queue_id");
       }
       long id = rs.getLong(1);
-      s = "UPDATE \"NEXT_COMPACTION_QUEUE_ID\" SET \"NCQ_NEXT\" = " + (id + 1);
+      s = "UPDATE \"NEXT_COMPACTION_QUEUE_ID\" SET \"NCQ_NEXT\" = " + (id + 1) 
+ " WHERE \"NCQ_NEXT\" = " + id;
       LOG.debug("Going to execute update <{}>", s);
-      stmt.executeUpdate(s);
+      if (stmt.executeUpdate(s) != 1) {

Review Comment:
   okay, we can live with a follow-up task, but in this case, I would like to 
see further minor improvements here:
   - HIVE-27121 <- refer to the follow-up task for better reference in a code 
comment
   - use LOG.info at least, this is an unhappy codepath, debug level is not 
enough
   - show the current id in the log message for better reference
   -



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -3647,9 +3647,12 @@ long generateCompactionQueueId(Statement stmt) throws 
SQLException, MetaExceptio
             + "no record found in next_compaction_queue_id");
       }
       long id = rs.getLong(1);
-      s = "UPDATE \"NEXT_COMPACTION_QUEUE_ID\" SET \"NCQ_NEXT\" = " + (id + 1);
+      s = "UPDATE \"NEXT_COMPACTION_QUEUE_ID\" SET \"NCQ_NEXT\" = " + (id + 1) 
+ " WHERE \"NCQ_NEXT\" = " + id;
       LOG.debug("Going to execute update <{}>", s);
-      stmt.executeUpdate(s);
+      if (stmt.executeUpdate(s) != 1) {

Review Comment:
   okay, we can live with a follow-up task, but in this case, I would like to 
see further minor improvements here:
   - HIVE-27121 <- refer to the follow-up task for better reference in a code 
comment
   - use LOG.info at least, this is an unhappy codepath, debug level is not 
enough
   - show the current id in the log message for better reference





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

    Worklog Id:     (was: 849306)
    Time Spent: 1.5h  (was: 1h 20m)

> Fix compaction related flaky tests
> ----------------------------------
>
>                 Key: HIVE-27117
>                 URL: https://issues.apache.org/jira/browse/HIVE-27117
>             Project: Hive
>          Issue Type: Task
>            Reporter: László Végh
>            Assignee: László Végh
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> The following tests turned out to be flaky recently:
>  * 
> org.apache.hadoop.hive.ql.TestTxnCommands2WithSplitUpdateAndVectorization.testDropTableAndCompactionConcurrent
>  * 
> org.apache.hadoop.hive.ql.txn.compactor.TestCompactionMetrics.testInitiatorFailuresCountedCorrectly
>  * 
> org.apache.hadoop.hive.ql.txn.compactor.TestCrudCompactorOnTez.testMajorCompactionNotPartitionedWithoutBuckets
>  * 
> org.apache.hadoop.hive.ql.txn.compactor.TestCrudCompactorOnTez.testCompactionWithCreateTableProps



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

Reply via email to