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

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

                Author: ASF GitHub Bot
            Created on: 27/Jan/22 12:33
            Start Date: 27/Jan/22 12:33
    Worklog Time Spent: 10m 
      Work Description: klcopp commented on a change in pull request #2971:
URL: https://github.com/apache/hive/pull/2971#discussion_r793559890



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java
##########
@@ -448,15 +461,15 @@ private boolean isFileBelowWatermark(FileStatus child, 
long highWatermark) {
     Path p = child.getPath();
     String fn = p.getName();
     if (!child.isDirectory()) {
-      return false;
+      return true;
     }
     if (fn.startsWith(AcidUtils.BASE_PREFIX)) {
       ParsedBaseLight b = ParsedBaseLight.parseBase(p);
-      return b.getWriteId() < highWatermark;
+      return b.getWriteId() <= highWatermark;

Review comment:
       The AcidDirectory could be based off of some older txn id (depending on 
how the Cleaner selects which compaction to pick up – if CQ_NEXT_TXN_ID is 
filled in the cleaner will only attempt to clean when it can, however if 
CQ_NEXT_TXN_ID==NULL then the cleaner will try to clean even if it's blocked by 
an obsolete dir). It could be that txnId=99 was opened, table a was created, 
table a is compacted many times but the cleaner will never clean anything from 
table a until txnid=99 is closed, because txnid=99 sees table a as totally 
empty.




-- 
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: 716397)
    Time Spent: 2.5h  (was: 2h 20m)

> Enhance Compaction Cleaner to skip when there is nothing to do
> --------------------------------------------------------------
>
>                 Key: HIVE-25883
>                 URL: https://issues.apache.org/jira/browse/HIVE-25883
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> the cleaner works the following way:
> * it identifies obsolete directories (delta dirs ; which doesn't have open 
> txns)
> * removes them and done
> if there are no obsolete directoris that is attributed to that there might be 
> open txns so the request should be retried later.
> however if for some reason the directory was already cleaned - similarily it 
> has no obsolete directories; and thus the request is retried for forever 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to