belliottsmith commented on code in PR #162: URL: https://github.com/apache/cassandra-accord/pull/162#discussion_r1935444383
########## accord-core/src/main/java/accord/impl/progresslog/DefaultProgressLog.java: ########## @@ -301,23 +303,40 @@ public List<TxnId> activeBefore(TxnId before) } @Override - public void clearBefore(TxnId clearWaitingBefore, TxnId clearAnyBefore) + public void clearBefore(SafeCommandStore safeStore, TxnId clearWaitingBefore, TxnId clearAllBefore) { + if (clearAllBefore.compareTo(clearWaitingBefore) >= 0) + clearWaitingBefore = clearAllBefore; + int index = 0; while (index < BTree.size(stateMap)) { TxnState state = BTree.findByIndex(stateMap, index); - if (state.txnId.compareTo(clearAnyBefore) < 0) + if (state.txnId.compareTo(clearWaitingBefore) >= 0) + return; + + boolean notify = state.waiting().blockedUntil() != NotBlocked + && state.waiting().homeSatisfies() == NotBlocked; + + if (notify) + { + // the command might be invalidated, which should be established on load, so simply load the command + TxnId txnId = state.txnId; + safeStore.commandStore().execute(PreLoadContext.contextFor(txnId), safeStore0 -> { Review Comment: I like this idea. It's a small change, will fold it in -- 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