19913750 (3) [Avatar] Offline
I'm having a hard time understanding part of the active/passive example code and description.

On page 193, the text states:

"at this point, you persist this newer state of the database, confirm all accumulated updates whose sequence number is smaller than the now-expected one, and try to apply all remaining updates by calling the consolidate function that is shown next"

If I'm understanding properly, the description corresponds to the following code from Listing 13.5:

case InitialState(m, s) if s > expectedSeq =>
log.info("received newer state at sequence {} (was at {})", s, expectedSeq)
persist(name, s, m)
waiting.to(s).valuesIterator foreach (r => r.replyTo ! Replicated(r.seq))
val nextWaiting = waiting.from(expectedSeq)
consolidate(m, s + 1, Set.empty, nextWaiting)


val nextWaiting = waiting.from(expectedSeq)


val nextWaiting = waiting.from(s+1)

Roland Kuhn (17) [Avatar] Offline
Yes, you are right, this has been added to the list of errata. Thanks for reporting it!