[ https://issues.apache.org/jira/browse/HIVE-25777?focusedWorklogId=715538&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-715538 ]
ASF GitHub Bot logged work on HIVE-25777: ----------------------------------------- Author: ASF GitHub Bot Created on: 26/Jan/22 08:55 Start Date: 26/Jan/22 08:55 Worklog Time Spent: 10m Work Description: klcopp commented on a change in pull request #2968: URL: https://github.com/apache/hive/pull/2968#discussion_r792422548 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java ########## @@ -1812,7 +1812,12 @@ private static void processBaseDir(Path baseDir, ValidWriteIdList writeIdList, V directory.getAbortedWriteIds().add(parsedBase.writeId); return; } - if (directory.getBase() == null || directory.getBase().getWriteId() < writeId) { + if (directory.getBase() == null || directory.getBase().getWriteId() < writeId + // If there are two competing versions of a particular write-id, one from the compactor and another from IOW, + // always pick the compactor one once it is committed. + || directory.getBase().getWriteId() == writeId && parsedBase.getVisibilityTxnId() > 0 Review comment: Just kind of a nit: there's an `isCompactedBase` method you could use instead of `parsedBase.getVisibilityTxnId() > 0`. It doesn't do much more but it would make this 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: 715538) Time Spent: 20m (was: 10m) > ACID: Pick the compactor transaction over insert dir > ---------------------------------------------------- > > Key: HIVE-25777 > URL: https://issues.apache.org/jira/browse/HIVE-25777 > Project: Hive > Issue Type: Bug > Components: Transactions > Affects Versions: 3.1.2, 4.0.0 > Reporter: Gopal Vijayaraghavan > Priority: Major > Labels: Compaction, pull-request-available > Time Spent: 20m > Remaining Estimate: 0h > > If there are two competing versions of a particular write-id, one from the > compactor and another from the original insert, always pick the compactor one > once it is committed. > If the directory structure looks like > {code} > base_000011/ > base_000011_v192/ > {code} > Then always pick the v192 transaction if txnid=192 is committed. > This is required to ensure that the raw base_ dir can be deleted safely on > non-atomic directory deletions (like s3), without a race condition between > getSplits and the actual file-reader. -- This message was sent by Atlassian Jira (v8.20.1#820001)