belliottsmith commented on code in PR #26:
URL: https://github.com/apache/cassandra-accord/pull/26#discussion_r1093760064
##########
accord-core/src/main/java/accord/messages/BeginRecovery.java:
##########
@@ -152,16 +164,18 @@ public RecoverReply reduce(RecoverReply r1, RecoverReply
r2)
if (!ok1.status.hasBeen(PreAccepted)) throw new
IllegalStateException();
PartialDeps deps = ok1.deps.with(ok2.deps);
+ PartialDeps acceptedDeps = ok1.deps == ok1.acceptedDeps && ok2.deps ==
ok2.acceptedDeps ? deps : ok1.acceptedDeps.with(ok2.acceptedDeps);
Review Comment:
If either are NONE then the operation bails out cheaply. We don't know if
either of them are NONE though, they might both be full deps. Perhaps I'm
misunderstanding. All I'm doing with the ternary is avoiding calling `with`
twice if I can reuse the prior result.
##########
accord-core/src/main/java/accord/messages/BeginRecovery.java:
##########
@@ -216,19 +230,21 @@ public static class RecoverOk extends RecoverReply
public final Ballot accepted;
public final Timestamp executeAt;
public final PartialDeps deps;
+ public final PartialDeps acceptedDeps; // only those deps that have
previously been proposed
Review Comment:
Yep, agreed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]