November 2019
Beginner to intermediate
470 pages
11h 59m
English
So far, we have learned a lot about replication. However, it is important to take a look at replication conflicts. The main question that arises is this: how can a conflict ever happen in the first place?
Consider the following example:
|
Master |
Slave |
|
DROP TABLE tab;
|
BEGIN; |
|
SELECT ... FROM tab WHERE ... |
|
|
... running ... |
|
|
... conflict happens ... |
|
|
... transaction is allowed to continue for 30 seconds ... |
|
|
... conflict is resolved or ends before timeout ... |
The problem here is that the master does not know that there is a transaction happening on the slave. Therefore, the DROP TABLE command does not block until the reading transaction is gone. If those two transactions happened on the ...
Read now
Unlock full access