belliottsmith commented on code in PR #213: URL: https://github.com/apache/cassandra-accord/pull/213#discussion_r2218818953
########## accord-core/src/main/java/accord/local/CommandStore.java: ########## @@ -548,6 +563,34 @@ final Supplier<EpochReady> bootstrapper(Node node, Ranges newRanges, long epoch) }; } + public boolean safeToRespond(TxnId txnId, Unseekables<?> participants) + { + return !unsafeGetRedundantBefore().isUnsafeBefore(txnId, participants); + } + + protected EpochReady rebootstrap(Node node, Ranges ranges, long epoch) + { + AsyncResult<EpochReady> metadata = submit(empty(), safeStore -> { + Bootstrap bootstrap = new Bootstrap(node, this, epoch, ranges, DataStore.RequestKind.Sync); + bootstraps.add(bootstrap); + // If rebootstrap can grab a later timestamp for subsequent attempts, but this timestamp is enough for us + // to establish what's safe to read + TxnId unsafeBefore = bootstrap.start(safeStore); + logger.debug("Rebootstrap timestamp on {}@{}: {}", id, node.id(), unsafeBefore); + unsafeUpsertRedundantBefore(RedundantBefore.create(ranges, unsafeBefore, SHARD_UNSAFE_BEFORE)); + return new EpochReady(epoch, null, null, + bootstrap.data, + bootstrap.reads); + }); + + AsyncResult<Void> readyToCoordinate = readyToCoordinate(ranges, epoch); Review Comment: I don't think this fully achieves its goal. We may have already notified other replicas that we are ready to coordinate, but we may no longer be. So while we need to recreate this collection and go through the motions again (to handle the case that we *haven't* notified other replicas of this), we need to refuse to answer *any* dependency requests for *any* intersecting transaction (regardless of its `TxnId`) until this completes. -- 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