I just followed these two videos:
Lecture: Write Concerns
That brings a question to my mind concerning the algorithm running when the primary node handles a write request from a client.
In my understanding the primary node has to perform these three tasks:
- Write the requested data to disk.
- Send a confirmation to the client: “Hey I received your request, I am done with it”.
- Send a message to the secondary nodes: “Hey guys, I got a write order from a client you have to replicate this.”
We can say that once these tasks are performed, the primary node job is basically done (with some possible detail variations according to the situation).
But what is less clear is the order in wich they are or should be performed.
Some order may make more sense than some other.
I presume for example that task 2) should be the last one executed, but is it what actually happens? For tasks 1) and 3) it seems less clear, I can see arguments for both choices (1 then 3 or 3 then 1). So what is actually happening?