Читать книгу From Traditional Fault Tolerance to Blockchain - Wenbing Zhao - Страница 52
EXAMPLE 2.4
ОглавлениеAn example run of the distributed snapshot protocol in a three-process distributed system is shown in Figure 2.8. P0 is the initiator of the round of the global checkpointing. P0 takes a local checkpoint and sends a Marker message along each of its outing channels. Upon receiving the Marker message, P1 immediately takes a local checkpoint and in turn sends a Marker message to each of its outgoing channels. Similarly, P2 takes a local checkpoint when it receives the first Marker message (from P1) and sends a Marker message to each of its outgoing channels connecting to P0 and P1, respectively.
Upon taking a local checkpoint, a process starts logging messages, if any, arrived at each incoming channel. The process stops logging messages for a channel as soon as it has received a Marker message from that channel. The messages logged will become the state for each channel. For P0, the channel state consists of a message m0. For P1, the channel state consists of a message m1. The channel state for P2 is empty because it did not receive any message prior to the receipt of the Marker message from each of its incoming channels. Note that the regular message received (such as m0 or m1) is executed immediately, which is drastically different from the Tamir and Sequin global checkpointing protocol.
Figure 2.8 Normal operation of the Chandy and Lamport global snapshot protocol in an example three-process distributed system.