Github user anew commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/61#discussion_r139287786 --- Diff: tephra-core/src/main/java/org/apache/tephra/util/TxUtils.java --- @@ -75,12 +75,9 @@ public static long getOldestVisibleTimestamp(Map<byte[], Long> ttlByFamily, Tran * @return The oldest timestamp that will be visible for the given transaction and TTL configuration */ public static long getOldestVisibleTimestamp(Map<byte[], Long> ttlByFamily, Transaction tx, boolean readNonTxnData) { - if (readNonTxnData) { - long maxTTL = getMaxTTL(ttlByFamily); - return maxTTL < Long.MAX_VALUE ? System.currentTimeMillis() - maxTTL : 0; - } - - return getOldestVisibleTimestamp(ttlByFamily, tx); + long ttlFactor = readNonTxnData ? 1 : TxConstants.MAX_TX_PER_MS; + long maxTTL = getMaxTTL(ttlByFamily); + return maxTTL < Long.MAX_VALUE ? tx.getTransactionId() - maxTTL * ttlFactor : 0; --- End diff -- this can be negative if a large TTL is used.
---