Open litt3 opened 6 months ago
Sounds like a good solution
Here are some more thoughts, after digging into the problem a bit more:
FREEZE_COMPLETE
ConsensusRoundHandler
is the first component to know about a freeze, but if the ConsensusRoundHandler
submits a flush request, how do we guarantee that the EventCreator
doesn't create new events after the flush, but before platform status changes to FREEZING
? EventCreator
monitors PlatformStatus
EventCreator
sees the platform status transition to FREEZING
, it immediately halts event creation, and sends a message to the pcesWriter
with the descriptor of the finalSelfEvent
that was created before the freezePcesWriter
is given 2 additional internal member variables: previousSelfEventWritten
(updated each time a self event is written to disk) and finalSelfEvent
(set via the message from the EventCreator
)
pcesWriter
will know when the finalSelfEvent
has been durably written (or has become ancient)pcesWriter
will be changed from a Long latestDurableSequenceNumber
to a record containing a long latestDurableSequenceNumber
, and a boolean finalSelfEventDurable
finalEventDurabilityNexus
is created, which monitors the output of the boolean finalSelfEventDurable
value coming out of the pcesWriter
ConsensusRoundHandler
is preparing to handle the transactions in the freeze round, it will do a blocking call into the finalEventDurabilityNexus
, and only proceed after the nexus indicates that the final self event is durable
finalSelfEvent
will be durably in the preconsensus stream before the freeze state is saved to disk
EventCreator
can't submit a state signature if it has stopped submitting events
FREEZE_COMPLETE