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

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

                Author: ASF GitHub Bot
            Created on: 21/May/21 17:46
            Start Date: 21/May/21 17:46
    Worklog Time Spent: 10m 
      Work Description: belugabehr commented on a change in pull request #2274:
URL: https://github.com/apache/hive/pull/2274#discussion_r637098230



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -365,7 +365,29 @@ public void markCleaned(CompactionInfo info) throws 
MetaException {
       ResultSet rs = null;
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
-        String s = "INSERT INTO \"COMPLETED_COMPACTIONS\"(\"CC_ID\", 
\"CC_DATABASE\", "
+
+        // Get all of this partition's COMPACTION_QUEUE entries in "ready for 
cleaning" with smaller id.
+        // TODO eventually change this to CQ_NEXT_TXN_ID (it might be null for 
some entires)
+        String s = "SELECT \"CQ_ID\" FROM \"COMPACTION_QUEUE\" WHERE 
\"CQ_DATABASE\"=? AND \"CQ_TABLE\"=? ";
+        if (info.partName != null) {
+          s += " AND \"CQ_PARTITION\" = ?";
+        }
+        s += " AND \"CQ_STATE\"='" + READY_FOR_CLEANING + "' AND \"CQ_ID\" <= 
" + info.id;
+        pStmt = dbConn.prepareStatement(s);
+        pStmt.setString(1, info.dbname);
+        pStmt.setString(2, info.tableName);
+        if (info.partName != null) {
+          pStmt.setString(3, info.partName);
+        }
+        LOG.debug("Going to execute query <" + s + "> for CQ_ID=" + info.id);

Review comment:
       `LOG.debug("Going to execute query <{}> for CQ_ID={}", s, info.id);`




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

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 600542)
    Time Spent: 50m  (was: 40m)

> Compaction queue entries may accumulate in "ready for cleaning" state
> ---------------------------------------------------------------------
>
>                 Key: HIVE-25115
>                 URL: https://issues.apache.org/jira/browse/HIVE-25115
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Karen Coppage
>            Assignee: Karen Coppage
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> If the Cleaner does not delete any files, the compaction queue entry is 
> thrown back to the queue and remains in "ready for cleaning" state.
> Problem: If 2 compactions run on the same table and enter "ready for 
> cleaning" state at the same time, only one "cleaning" will remove obsolete 
> files, the other entry will remain in the queue in "ready for cleaning" state.



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

Reply via email to