Sequences and identity columns within a multi-master context are especially prone to complications. PostgreSQL itself is essentially unaware of the presence of other PostgreSQL nodes that may refer to the same sequences, and each node operates independently of the others in that regard.
As a result, each new incremental value from a standard sequence is arbitrary and could result in duplicate values on nodes. This would be a disaster if we are using them for a primary key, as any conflicts here would result in lost data.
This recipe will demonstrate how to safely use sequences with BDR and prevent any node from producing conflicting values.