Database / Mnesia intermediate to advanced Interview questions
How does setting master nodes influence conflict resolution after a network partition?
When a partition heals and Mnesia detects that a table's replicas diverged, its default behavior is to
raise an inconsistent_database_event and leave the decision of which side to trust to an operator
or a configured event handler, since it has no inherent basis to prefer one side over the other. Master node
configuration removes that ambiguity ahead of time for a given table.
flowchart TD
A[Partition heals, conflict detected] --> B{Master node configured for this table?}
B -->|Yes| C[Master node's data treated as authoritative; other replicas resync from it]
B -->|No| D[inconsistent_database_event raised; manual/handler resolution required]
With master nodes set, the recovery process becomes more automatic and predictable: replicas that disagree with the designated master simply resync to match it, rather than requiring someone to manually inspect both sides and decide (potentially under time pressure during an incident) which one to keep.
More Related questions...