ifesdjeen commented on code in PR #230: URL: https://github.com/apache/cassandra-accord/pull/230#discussion_r2229109983
########## accord-core/src/main/java/accord/local/Node.java: ########## @@ -221,12 +221,10 @@ public Node(Id id, MessageSink messageSink, this.random = random; this.persistDurableBefore = new PersistentField<>(() -> durableBefore, (input, prev) -> { - if (input.fullyContainedIn(prev)) - { - Invariants.expect(prev.equals(DurableBefore.merge(input, prev))); + DurableBefore next = DurableBefore.merge(input, prev); Review Comment: to be honest I was hoping for a check that is cheaper than full durable before comparison but looks like fully contained in did not work? ########## accord-core/src/main/java/accord/impl/InMemoryCommandStore.java: ########## @@ -325,9 +325,18 @@ public boolean hasCommandsForKey(RoutingKey key) @Override protected void ensureDurable(Ranges ranges, RedundantBefore onCommandStoreDurable) { - ((InMemoryAgent)agent).snapshot(this).begin((success, fail) -> execute((Empty)() -> "Report CommandStore Durable", safeStore -> { - safeStore.upsertRedundantBefore(onCommandStoreDurable); - }).begin(agent)); + // TODO (required): we need a more general Replaying state + if (!CommandsForKey.reportLinearizabilityViolations()) Review Comment: hah, yes, maybe we should add a static flag and use it in CommandsForKey.reportLinearizabilityViolations? ########## accord-core/src/main/java/accord/impl/AbstractReplayer.java: ########## @@ -66,30 +66,32 @@ protected boolean shouldReplay(TxnId txnId, StoreParticipants participants) protected void initialiseState(SafeCommandStore safeStore, TxnId txnId) { SafeCommand safeCommand = safeStore.unsafeGet(txnId); - Command command = safeCommand.current(); - if (command.saveStatus().compareTo(SaveStatus.Stable) >= 0 && command.saveStatus().compareTo(PreApplied) <= 0) Review Comment: just wondering why indent here? to avoid leaking `command` ref? -- 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