educative.io

Educative

Consistent and inconsistent states

Could you please provide more information on the two states and also additional example, if possible, please ?

Hi @Adithya, thank you for reaching us.

Checkpointing is a way to periodically record a complete state of a system in separate storage so, in case of any failure, we can load back to that state. This is an excellent approach to add fault tolerance in the system.
While checkpointing, the timing is very important, we should always perform checkpointing in a consistent state. A system is in a consistent state when all the messages that are sent are received so that no information is left to be recorded.
If the system is under any process while the checkpointing is taking place, then this means the backup is made at an inconsistent state, and if we load back to this backup, some information will be lost because the checkpointing was done at an inconsistent state.

Example:
Processes A, B, and C are communicating, and we are to record checkpoints.

Process A sends a message to processes B, and C. Let’s assume that process A sent the messages to processes B and C at 1:10 AM.

Process B received the message at 1:12 AM, and process C received the message at 1:14 AM.

If checkpointing was made at 1:13 AM, that means the message that process A sent to process C was not recorded, and if are to roll back to this backup recorded at 1:13 AM, we will have no information of the message that process A sent to process C because the checkpointing was made at an inconstant state.

Hope Educative has helped you in your learning :slight_smile: