Github user poornachandra commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/19#discussion_r86889731
  
    --- Diff: tephra-core/src/main/java/org/apache/tephra/util/TxUtils.java ---
    @@ -149,4 +149,15 @@ private static long getMaxTTL(Map<byte[], Long> 
ttlByFamily) {
       public static boolean isPreExistingVersion(long version) {
         return version < MAX_NON_TX_TIMESTAMP;
       }
    +
    +  /**
    +   * Returns the maximum transaction that can be removed from the invalid 
list for the state represented by the given
    +   * transaction.
    +   */
    +  public static long getPruneUpperBound(Transaction tx) {
    +    long maxInvalidTx =
    +      tx.getInvalids().length > 0 ? 
tx.getInvalids()[tx.getInvalids().length - 1] : Transaction.NO_TX_IN_PROGRESS;
    +    long firstInProgress = tx.getFirstInProgress();
    +    return Math.min(maxInvalidTx, firstInProgress - 1);
    --- End diff --
    
    Good catch, updated the code to use the current read pointer in such a case


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to