Background information that I know(But not understand with examples, I will be glad if you could explain it to me with examples)
A replicated service is said to be linearizable if for any executin there is some interleaving of operations that
Meets the specifications of a non replicated service
Matches the real time order of operations in actual execution.
A replicated service is said to be sequentially consistent if for any execution there is some interleaving of operations that
Meets the specifications of a non replicated service
Matches the program order of operations in actual execution.
Here is what is written in Colouris's distributed system book about the example I have shown in image-
This execution is possible under a naive replication strategy even if neither of the computers A or B fails but if update of x that client 1 made at B hasn't reached A when client 2 reads it. The real time criterion for linearizability is not satisfied, since $getBalance_A(x)\to 0$ occurs later than $setBalance_B(x,1)$: but the following interleaving satisfies both criteria for sequential consistency: $getBalance_A(y)\to 0$,$getBalance_A(x)\to 0$, $setBalance_B(x,1)$,$setBalance_A(y,2)$
I am failing to comprehend anything written here. I think it is mainly because of my failure to understand the example of linearizability and sequential consistency. Can you shed some light here and help me out here? I will be really grateful for any help.