Github user ohadshacham commented on a diff in the pull request: https://github.com/apache/incubator-omid/pull/46#discussion_r223974301 --- Diff: hbase-client/src/main/java/org/apache/omid/transaction/SnapshotFilterImpl.java --- @@ -181,22 +179,44 @@ public CommitTimestamp locateCellCommitTimestamp(long cellStartTimestamp, long e // 2) Then check the commit table // If the data was written at a previous epoch, check whether the transaction was invalidated - Optional<CommitTimestamp> commitTimeStamp = commitTableClient.getCommitTimestamp(cellStartTimestamp).get(); - if (commitTimeStamp.isPresent()) { - return commitTimeStamp.get(); + boolean invalidatedByOther = false; + Optional<CommitTimestamp> commitTimestampFromCT = commitTableClient.getCommitTimestamp(cellStartTimestamp).get(); + if (commitTimestampFromCT.isPresent()) { + if (isLowLatency && !commitTimestampFromCT.get().isValid()) + invalidatedByOther = true; + else + return commitTimestampFromCT.get(); } // 3) Read from shadow cell - commitTimeStamp = readCommitTimestampFromShadowCell(cellStartTimestamp, locator); + Optional<CommitTimestamp> commitTimeStamp = readCommitTimestampFromShadowCell(cellStartTimestamp, locator); if (commitTimeStamp.isPresent()) { return commitTimeStamp.get(); } + // In case of LL, if found invalid ct cell, still must check sc in stage 3 then return + if (invalidatedByOther) { + assert(!commitTimestampFromCT.get().isValid()); + return commitTimestampFromCT.get(); + } + // 4) Check the epoch and invalidate the entry --- End diff -- or invalidate in a non latency mode
---