ifesdjeen commented on code in PR #224: URL: https://github.com/apache/cassandra-accord/pull/224#discussion_r2210795047
########## accord-core/src/main/java/accord/local/MaxDecidedRX.java: ########## @@ -37,9 +47,64 @@ private MaxDecidedRX(boolean inclusiveEnds, Object[] tree) super(inclusiveEnds, tree); } - TxnId get(Routables<?> keysOrRanges) + TxnId min(Routables<?> keysOrRanges) + { + return noneIfNull(foldlWithDefault(keysOrRanges, TxnId::nonNullOrMin, null, TxnId.NONE)); + } + + TxnId max(Routables<?> keysOrRanges) + { + return maxIfNull(foldlWithDefault(keysOrRanges, TxnId::nonNullOrMax, null, TxnId.MAX)); + } + + TxnId min(Range range) + { + return noneIfNull(foldlWithDefault(range, TxnId::nonNullOrMin, null, TxnId.NONE)); + } + + TxnId max(Range range) + { + return maxIfNull(foldlWithDefault(range, TxnId::nonNullOrMax, null, TxnId.MAX)); + } + + public @Nullable TxnId minDecidedDependencyId(Unseekables<?> keysOrRanges, TxnId txnId) + { + Invariants.require(txnId.is(Txn.Kind.ExclusiveSyncPoint)); + // first check max, as if this is later we don't know that we can safely filter + TxnId maxDecidedId = max(keysOrRanges); + if (maxDecidedId.compareTo(txnId) < 0) + return min(keysOrRanges); + return null; + } + + public @Nullable TxnId minDecidedDependencyId(Unseekable keyOrRange, TxnId txnId) Review Comment: Intended to be unused? ########## accord-core/src/main/java/accord/coordinate/MaybeRecover.java: ########## @@ -82,19 +84,26 @@ protected void onDone(Success success, Throwable fail) // this can be helpful in mitigating flakiness and helping forward progress for large transactions spanning many shards if (fail != null) { + if (tracing != null) Review Comment: should we generally format tracing in a single line? -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org