Chapter 9. Multi-master conflicts

Table of Contents
9.1. How conflicts happen
9.2. Types of conflict
9.2.1. PRIMARY KEY or UNIQUE conflicts
9.2.2. Foreign Key Constraint conflicts
9.2.3. Exclusion constraint conflicts
9.2.4. Global data conflicts
9.2.5. Lock conflicts and deadlock aborts
9.2.6. Divergent conflicts
9.3. Avoiding or tolerating conflicts
9.4. User defined conflict handlers
9.5. Conflict logging

In multi-master use of BDR writes to the same or related table(s) from multiple different nodes can result in data conflicts.

Some clustering systems use distributed lock mechanisms to prevent concurrent access to data. These can perform reasonably when servers are very close but cannot support geographically distributed applications as very low latency is critical for acceptable performance.

Distributed locking is essentially a pessimistic approach, whereas BDR advocates an optimistic approach: avoid conflicts where possible but allow some types of conflict to occur and and resolve them when they arise.