Improvements to BDR/UDR join sanity checking
authorCraig Ringer <craig@2ndquadrant.com>
Mon, 22 Jun 2015 07:30:07 +0000 (15:30 +0800)
committerCraig Ringer <craig@2ndquadrant.com>
Mon, 22 Jun 2015 07:30:07 +0000 (15:30 +0800)
commit6c58dfe4c5f4b972059454b98c1bb709b45e7930
tree4596a05e511ecf2b6bd1a6063f8c788067f91b36
parent0b83003440e086515bd7317437a373e641266d30
Improvements to BDR/UDR join sanity checking

This is a set of related changes to the init/join
processes, focused on sanity checks and robustness
when joining nodes.

Introduces extension rev bdr 0.10.0.5.

* Expose bdr_internal_create_truncate_trigger function
  to add the bdr truncate_trigger to a table. Use it
  from bdr_truncate_trigger_add.

* Use bdr_truncate_trigger_add in bdr_group_join to
  create truncate triggers on all existing tables
  when BDR gets enabled. Previously we'd fail to
  replicate TRUNCATE for tables created before
  CREATE EXTENSION bdr; was run.

* Fix broken prototype for bdr_truncate_trigger_add

* In bdr_group_join prohibit enabling BDR where
  exclusion constraints exist in the database's
  current state. Previously you could get a BDR
  db with exclusion constraints and/or a broken
  clone by creating a table with exclusion constraints
  before enabling BDR.

* In bdr_group_join, warn users if there are
  secondary unique indexes on tables, as currently
  we can't do last-update-wins conflict handling
  on tuples that violate multiple unique constraints.
  See issue #95. Still permit join to continue.

* Warn users about missing PRIMARY KEYs, but
  permit join to continue, as it's legal to
  have no PK on an INSERT-only table.

* In bdr.internal_begin_join, use
  bdr_test_replication_connection to test the remote
  DSN in replication mode and make sure that pg_hba.conf
  permits connection in replication mode. Fixes #94.
Makefile.in
bdr.control
bdr_executor.c
expected/init_bdr.out
expected/upgrade.out
extsql/bdr--0.10.0.4--0.10.0.5.sql [new file with mode: 0644]
sql/upgrade.sql