[ https://issues.apache.org/jira/browse/TEPHRA-216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15861890#comment-15861890 ] ASF GitHub Bot commented on TEPHRA-216: --------------------------------------- Github user gokulavasan commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/34#discussion_r100632110 --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/txprune/HBaseTransactionPruningPlugin.java --- @@ -322,6 +333,28 @@ private long computePruneUpperBound(TimeRegions timeRegions) throws IOException return -1; } + private Map handleEmptyRegions(long inactiveTransactionBound, + SortedSet transactionalRegions, + Map pruneUpperBoundRegions) throws IOException { + long inactiveTransactionBoundTime = TxUtils.getTimestamp(inactiveTransactionBound); + SortedSet emptyRegions = + dataJanitorState.getEmptyRegionsAfterTime(inactiveTransactionBoundTime, transactionalRegions); + LOG.debug("Got empty transactional regions for inactive transaction bound time {}: {}", + inactiveTransactionBoundTime, Iterables.transform(emptyRegions, TimeRegions.BYTE_ARR_TO_STRING_FN)); + + // The regions that are recorded as empty after inactiveTransactionBoundTime will not have invalid data + // for transactions started before or on inactiveTransactionBoundTime. Hence we can consider the prune upper bound + // for these empty regions as inactiveTransactionBound + Map pubWithEmptyRegions = new TreeMap<>(Bytes.BYTES_COMPARATOR); + pubWithEmptyRegions.putAll(pruneUpperBoundRegions); + for (byte[] emptyRegion : emptyRegions) { + if (!pruneUpperBoundRegions.containsKey(emptyRegion)) { --- End diff -- Shouldn't this condition be reversed? If the region is empty, set the upper bound for it to be ``inactiveTransactionBound`` . > Invalid Transaction List Pruning will not proceed if there are empty transactional tables > ----------------------------------------------------------------------------------------- > > Key: TEPHRA-216 > URL: https://issues.apache.org/jira/browse/TEPHRA-216 > Project: Tephra > Issue Type: Sub-task > Affects Versions: 0.11.0-incubating > Reporter: Gokul Gunasekaran > Assignee: Poorna Chandra > > Since empty table/regions might not undergo major compaction, the prune upper bound of these regions will never have a value and thus will limit the progress of invalid list transaction pruning. -- This message was sent by Atlassian JIRA (v6.3.15#6346)