BDR Consistency in Insert/Update pkey conflicts

From: Robert Berry <berrydigital(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: BDR Consistency in Insert/Update pkey conflicts
Date: 2014-11-30 22:49:45
Message-ID: CAM=RetHq3fsfvpTms0HH_RM4GS7hT-K3Qrof1JpeyT2rqyr97Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm curious to know what the expected behavior is for an insert / update
conflict on a primary key field.

The wiki suggested "divergence conflicts" would be logged and replication
would halt for the downstream master. There is a case where the databases
"diverge" such that they are no longer consistent, and where no error is
logged and replication continues.

The test case is summarized as inserting a record on a first node with
pkey='x'. After this record propagates, then insert a record with a
different node with pkey='y', and at the same time update the first node's
record to change the key to 'y'. Depending on timing, the result is that
the first node will only have a single record, while the other nodes will
have an x and y record.

The full test case is at:
https://github.com/no0p/bdrlab/blob/master/bdrsuite/tests/conflicts/insert_update_conflict.rb

Is this considered a divergence conflict and what is the expected behavior
for this case?

Also is there is a published list of conditions where masters can become
inconsistent and that is expected behavior -- or should that never happen?

Best Regards,
Robert

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Barwick 2014-12-01 00:31:12 Typo/spacing fix for "29.1. Reliability"
Previous Message Andrew Dunstan 2014-11-30 21:48:14 Re: [BUGS] BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON