Craig Ringer [Mon, 23 Mar 2015 09:04:38 +0000 (17:04 +0800)]
bdr: add bdr_parse_slot_name and bdr_format_slot_name
Provide SQL-callable functions wrapping existing internal
BDR helpers for parsing and formatting BDR slot names.
This allows users to associate a slot name in pg_replication_slots
with an entry in bdr.bdr_nodes or bdr.bdr_connections without
writing their own slot parsing code that might be buggy and/or
break with later changes.
Craig Ringer [Mon, 23 Mar 2015 05:26:35 +0000 (13:26 +0800)]
bdr: doc: Explain physical vs logical node join, reduce duplication
Craig Ringer [Mon, 23 Mar 2015 03:43:42 +0000 (11:43 +0800)]
bdr: doc: Add stub docs for upgrade
Add skeletal upgrade docs with entry for bdr_upgrade_to_090.
Also documents bdr_replicate_ddl_command
Craig Ringer [Mon, 23 Mar 2015 03:21:15 +0000 (11:21 +0800)]
bdr: doc: Table entries for all public bdr functions
Craig Ringer [Mon, 23 Mar 2015 02:02:22 +0000 (10:02 +0800)]
bdr: doc: Change xref destinations for bdr.bdr_subscribe
Petr Jelinek [Mon, 23 Mar 2015 00:16:09 +0000 (01:16 +0100)]
bdr: doc: Always generate TOC even if section only has single entry.
Petr Jelinek [Sun, 22 Mar 2015 22:26:14 +0000 (23:26 +0100)]
bdr: doc: More detailed docs for bdr.bdr_subscribe().
Petr Jelinek [Sun, 22 Mar 2015 20:45:29 +0000 (21:45 +0100)]
bdr: silence compiler warning in UDR
Petr Jelinek [Sun, 22 Mar 2015 20:43:04 +0000 (21:43 +0100)]
bdr: Add synchronize parameter to bdr_subscribe
The new parameter controls what part of db should be synchronized
(copied). Currently supported values are 'none' for no synchronization
and 'full' for full dump/restore.
Craig Ringer [Fri, 20 Mar 2015 09:04:42 +0000 (17:04 +0800)]
bdr: doc: Top-level structure tweaks, overview editing
Craig Ringer [Fri, 20 Mar 2015 06:32:08 +0000 (14:32 +0800)]
bdr: doc: flatten install chapter a level
Craig Ringer [Fri, 20 Mar 2015 04:55:44 +0000 (12:55 +0800)]
bdr: doc: Copy-editing on the quickstart guide
Some minor changes to the quickstart formatting and wording. Also remove
the old and unused quickstart doc.
kforte90 [Thu, 19 Mar 2015 22:55:17 +0000 (15:55 -0700)]
Merge branch 'bdr-plugin/next' of ssh://git.postgresql.org/2ndquadrant_bdr into bdr-plugin/next
Christoph Moench-Tegeder [Thu, 19 Mar 2015 22:29:51 +0000 (23:29 +0100)]
bdr: replication set management
Christoph Moench-Tegeder [Thu, 19 Mar 2015 22:23:25 +0000 (23:23 +0100)]
bdr: description of replication set functions
Christoph Moench-Tegeder [Thu, 19 Mar 2015 22:04:05 +0000 (23:04 +0100)]
bdr: fix formatting
kforte90 [Thu, 19 Mar 2015 21:03:52 +0000 (14:03 -0700)]
bdr: doc: Added quickstart-install.sgml, quickstart-test.sgml
Modified bdr.sgml and filelist.sgml to added two files above
Craig Ringer [Thu, 19 Mar 2015 05:24:27 +0000 (13:24 +0800)]
bdr: doc: Copy-editing and more cross references
Adds more cross references and removes some FIXMEs. Lots
of copy editing. Flesh out a few explanations.
Craig Ringer [Thu, 19 Mar 2015 04:53:49 +0000 (12:53 +0800)]
bdr: doc: Revise and copy-edit the DDL replication chapter
Copy-editing, explanation of some restrictions, etc.
Craig Ringer [Thu, 19 Mar 2015 04:33:56 +0000 (12:33 +0800)]
bdr: doc: correct cross-reference labels
Christoph Moench-Tegeder [Wed, 18 Mar 2015 09:29:05 +0000 (10:29 +0100)]
reset PGconn object whenever connection is closed
Andres Freund [Tue, 17 Mar 2015 08:11:47 +0000 (09:11 +0100)]
bdr: Properly define bdr_abs_srcdir to be, well, actually absolute.
Fixes GH #6
Christoph Moench-Tegeder [Sun, 15 Mar 2015 22:07:40 +0000 (23:07 +0100)]
bdr: fix open() flags of destination in copy_file()
- the destination file is not guaranteed to exist, so O_CREAT must be used.
- O_TRUNC has to be set to make sure there will be no leftovers at the end
of the file in case the destination file already existed.
Petr Jelinek [Sat, 14 Mar 2015 11:24:06 +0000 (12:24 +0100)]
bdr: doc: Add chapter about bdr_init_copy
Craig Ringer [Tue, 10 Mar 2015 14:36:51 +0000 (22:36 +0800)]
bdr: doc: more explanation of multi-master
Craig Ringer [Tue, 10 Mar 2015 11:09:06 +0000 (19:09 +0800)]
bdr: doc: Much more in depth concepts/overview section
Christoph Moench-Tegeder [Mon, 9 Mar 2015 13:25:27 +0000 (14:25 +0100)]
find "extended" (GNU) getopt
FreeBSD's stock getopt(1) breaks with the long options, so
we have to find a better one. TODO: move that to configure
Christoph Moench-Tegeder [Mon, 9 Mar 2015 12:34:00 +0000 (13:34 +0100)]
use env to call bash, as bash may not be installed in /bin
Andres Freund [Sun, 8 Mar 2015 17:03:01 +0000 (18:03 +0100)]
bdr: Add tests for DDL replication of storage options during CREATE TBL.
Fixes GH: #3
Craig Ringer [Wed, 18 Feb 2015 05:25:05 +0000 (18:25 +1300)]
bdr: doc: document getting sources, document signing
Craig Ringer [Wed, 18 Feb 2015 02:58:45 +0000 (15:58 +1300)]
bdr: doc: move the preface into the book abstract
Craig Ringer [Wed, 18 Feb 2015 02:01:06 +0000 (15:01 +1300)]
bdr: doc: Split the docs up by part/chapter like the Pg docs
Craig Ringer [Wed, 18 Feb 2015 00:21:04 +0000 (13:21 +1300)]
bdr: doc: ignore generated docs
Craig Ringer [Wed, 18 Feb 2015 00:20:29 +0000 (13:20 +1300)]
bdr: doc: Document installation from packages
Andres Freund [Mon, 16 Feb 2015 11:19:55 +0000 (12:19 +0100)]
bdr: doc: Add preliminary installation instructions & random doc cleanups.
Andres Freund [Fri, 13 Feb 2015 18:50:11 +0000 (19:50 +0100)]
bdr: doc: Massivley expand documentation about BDR DDL restrictions.
Andres Freund [Thu, 12 Feb 2015 17:59:16 +0000 (18:59 +0100)]
bdr: Fix bdr.do_not_replicate implementation.
Luckily the only consequence of the borked implementation was that
pg_get_replication_identifier_progress() failed with an assertion
failure. There was no problem with replaying those changes because the
other nodes aren't allowed to connect at that point.
Andres Freund [Thu, 12 Feb 2015 09:29:36 +0000 (10:29 +0100)]
bdr: docs: Fix indentation in a couple places.
Andres Freund [Thu, 12 Feb 2015 09:29:17 +0000 (10:29 +0100)]
bdr: Start documentation about not replicated statements.
Andres Freund [Wed, 11 Feb 2015 16:14:13 +0000 (17:14 +0100)]
bdr: Make parameters for group_create/group_join/subscribe more consistent.
Andres Freund [Mon, 9 Feb 2015 21:33:01 +0000 (22:33 +0100)]
bdr: Start to explain some concepts in the docs.
Initial explanation of distributed sequences, ddl replication and ddl
locking are included.
Andres Freund [Mon, 9 Feb 2015 20:37:20 +0000 (21:37 +0100)]
bdr: Fix dependencies on the website css for the docs.
Andres Freund [Mon, 9 Feb 2015 20:34:24 +0000 (21:34 +0100)]
bdr: Only set VPATH build variables when actually doing a vpath build...
Fixes building the docs from within the source directory. No need to
backpatch, as we previously didn't rely on srcdir being set.
Andres Freund [Mon, 9 Feb 2015 20:16:40 +0000 (21:16 +0100)]
bdr: Add document about bdr guc settings.
Andres Freund [Mon, 9 Feb 2015 19:52:51 +0000 (20:52 +0100)]
bdr: Copy docs css from the website, looks much better.
Andres Freund [Mon, 9 Feb 2015 16:55:38 +0000 (17:55 +0100)]
bdr: Remove the now unused bdr.connections GUC.
Petr Jelinek [Mon, 9 Feb 2015 20:05:16 +0000 (21:05 +0100)]
bdr: Add bdr_nodes entry for remote node when subscribing.
This makes it possible to join between bdr_nodes and bdr_connections
correctly.
Andres Freund [Mon, 9 Feb 2015 16:40:59 +0000 (17:40 +0100)]
bdr: Document (and link to) relevant postgres parameters.
Andres Freund [Mon, 9 Feb 2015 02:42:09 +0000 (03:42 +0100)]
bdr: Implement simple node removal via bdr.bdr_part_by_node_names().
The method used to remove node is relatively simplistic: Removed nodes
are left in bdr_nodes and there's no guarantee about
consistency/concurrency for node removal.
The concurrency issues primarily arethat the method used for removal
could lead to ddl locks and sequence chunks could be granted based on
votes by the removed node, with the quorum from after the removal. That
obviously needs to be improved, but this is an important step.
Andres Freund [Mon, 9 Feb 2015 02:40:37 +0000 (03:40 +0100)]
bdr: Also setup pid/pgproc entries in the output plugins shmem slot.
Andres Freund [Mon, 9 Feb 2015 02:39:32 +0000 (03:39 +0100)]
bdr: Parse & remember the remotes identity in the output plugin.
This is useful to later be able to kill & prevent them from rejoining
when removing a node.
Andres Freund [Mon, 9 Feb 2015 02:37:08 +0000 (03:37 +0100)]
bdr: Rename bdr_launch_apply_workers() to maintain_db_workers().
Also remove a superflous argument that could only ever be set to to
MyDatabaseId.
Andres Freund [Mon, 9 Feb 2015 02:33:14 +0000 (03:33 +0100)]
bdr: Don't proc_exit(0) in normal paths of the apply process.
Doing so unregisters the worker, which is usually not what's
wanted. Instead replace the one location that wants to unregister, and
use 1 as an exit code everywhere else.
Andres Freund [Mon, 9 Feb 2015 02:30:05 +0000 (03:30 +0100)]
bdr: Add bdr_parse_slot_name and clean up some related code.
Andres Freund [Mon, 9 Feb 2015 02:28:08 +0000 (03:28 +0100)]
bdr: Fix typo in dbcache leading to cache invalidation not working.
Andres Freund [Sun, 8 Feb 2015 17:41:00 +0000 (18:41 +0100)]
bdr: Wakeup perdb worker when bdr_node changes are replayed.
Andres Freund [Sun, 8 Feb 2015 17:33:37 +0000 (18:33 +0100)]
bdr: Slightly improve caching of relation/schema oids.
Only declare variables that are actually defined and also persistently
store the bdr schema oid.
Andres Freund [Sun, 8 Feb 2015 17:03:19 +0000 (18:03 +0100)]
bdr: Fix bdr_connections_changed() to not register its hook multiple times.
While add it, rename xacthook_connection_added to
xacthook_connections_changed to more precisely reflect its usage.
Andres Freund [Sun, 8 Feb 2015 14:55:01 +0000 (15:55 +0100)]
bdr: Require a node name when creating/joining a bdr flock.
bdr_init_copy is untested as of now.
Andres Freund [Sun, 8 Feb 2015 13:43:09 +0000 (14:43 +0100)]
bdr: Improve makefile regeneration dependencies.
Andres Freund [Sun, 8 Feb 2015 12:06:43 +0000 (13:06 +0100)]
bdr/udr: create scripts/ directory and set x permissions for bdr_initial_load.
This got broken in "bdr: Replace GUC-based connections with SQL and
tables", but the new fix is nicer and more complete. So it's ok not to
backpatch it.
Petr Jelinek [Sun, 8 Feb 2015 12:27:04 +0000 (13:27 +0100)]
bdr: typo fix
Andres Freund [Thu, 5 Feb 2015 16:34:40 +0000 (17:34 +0100)]
bdr: Acquire a shmem slot in the bdr output plugin.
This is helpful because we now can find nodes connected to a specific
slot which we need to implement node removal.
Andres Freund [Thu, 5 Feb 2015 13:45:01 +0000 (14:45 +0100)]
bdr: Remove bdr.max_workers and bdr.max_databases GUCs and infer them.
The complications of having those doesn't seem worth the minute amount
of processing they can save in a hypothetical environment with large
max_workers settings.
Andres Freund [Thu, 5 Feb 2015 13:08:01 +0000 (14:08 +0100)]
bdr: Further improve and seperate out BDR worker infrastructure.
Most shared memory handling now resides in bdr_shmem.c and worker
slots are acquired using a distinct function.
This has the advantage of making bdr.c a bit less of a hodgepodge and
is preparation for acquiring worker slots in walsenders.
Andres Freund [Wed, 4 Feb 2015 23:28:08 +0000 (00:28 +0100)]
bdr: dynconf: Improve worker slot handling.
Move worker slot acquiration into bdr_worker_init() and register
before_shmem_exit() function that marks the slot as unused on process
exit. Use that functionality to always keep the pid and PGPROC entry
in worker slots if a bgworker is connected.
Craig Ringer [Sat, 7 Feb 2015 11:54:17 +0000 (00:54 +1300)]
bdr: Replace GUC-based connections with SQL and tables
BDR's configuration interface and the related internals have been mostly
rewritten so that GUCs are not used for specifying bdr connections.
The bdr.connectons GUC and bdr.<nodename>_dsn etc are removed by this
commit. Use of these settings will now emit warnings in the server error
log.
Upgrades to the new version must be performed with manual steps covered
in the documentation. Simply replacing the binaries is not sufficient.
Major changes:
* There is only one static worker, a new bdr_supervisor worker
* The supervisor decides which databases to start per-db workers
for by examining each database for a 'bdr' security label
* per-db workers scan a new bdr.bdr_connections table to decide
which nodes to launch apply workers for.
* apply workers look up bdr.bdr_connections to get connection
info instead of checking GUCs
* Explicit creation of the first node is now required with
bdr.bdr_group_create(...)
* New nodes must be joined with an SQL level bdr.bdr_group_join(...)
call.
Craig Ringer [Sat, 7 Feb 2015 10:51:03 +0000 (23:51 +1300)]
bdr: add stringify_node_identity helper
Craig Ringer [Fri, 30 Jan 2015 05:47:36 +0000 (16:47 +1100)]
bdr: add bdr_copytable function for copying between conns
bdr_copytable copies a table between two libpq connections.
The caller supplies the COPY queries. It's intended for use
from C, but a test interface is available at the SQL level
for use in the unit tests, and could be renamed to be
made officially public if desired.
Craig Ringer [Fri, 6 Feb 2015 11:31:51 +0000 (00:31 +1300)]
bdr: add bdr_test_remote_connectback(..)
Craig Ringer [Fri, 6 Feb 2015 11:31:19 +0000 (00:31 +1300)]
bdr: add bdr_test_replication_connection(...)
Craig Ringer [Fri, 6 Feb 2015 13:37:58 +0000 (02:37 +1300)]
bdr: refactor bdr_connect to be more useful to other callers
Craig Ringer [Fri, 6 Feb 2015 11:29:55 +0000 (00:29 +1300)]
bdr: add bdr_get_remote_nodeinfo(...)
Add a utility function that permits a remote node to be probed
for BDR identification information of interest.
Andres Freund [Mon, 19 Jan 2015 14:20:38 +0000 (15:20 +0100)]
bdr: Add caching layer above databases.
Currently that layer is just used to cache (and abstract away) checks
whether a database is enabled for bdr. But likely we'll end up caching
additional data in there.
FIXME: Right now this isn't going to work for UDR. We need to make it
set a flag on the source side for it.
Craig Ringer [Tue, 27 Jan 2015 10:59:56 +0000 (21:59 +1100)]
bdr: Add bdr_error_nodeids_must_differ for a common error
Craig Ringer [Tue, 27 Jan 2015 00:44:28 +0000 (11:44 +1100)]
bdr: add bdr_parse_version(...)
Provide a utility function for parsing a text BDR version
Craig Ringer [Sat, 7 Feb 2015 07:23:39 +0000 (20:23 +1300)]
bdr: rename worker struct members/unions to be shorter
Renames BdrWorker.worker_data => BdrWorker.data
and renames its union members:
* apply_worker => apply
* perdb_worker => perdb
as well as the bdr_perdb_worker variable in bdr_perdb.c
Andres Freund [Sun, 8 Feb 2015 12:06:27 +0000 (13:06 +0100)]
Fix VPATH build against 9.4 (i.e. UDR).
Craig Ringer [Wed, 4 Feb 2015 11:09:43 +0000 (22:09 +1100)]
bdr: Bump bdr-plugin/next to 0.9.0
Craig Ringer [Fri, 6 Feb 2015 03:56:18 +0000 (14:56 +1100)]
bdr: Ignore generated Makefile.global and doc/Makefile
Craig Ringer [Fri, 6 Feb 2015 03:53:15 +0000 (14:53 +1100)]
bdr: Make some more externally callable functions PGDLLEXPORT
Andres Freund [Wed, 4 Feb 2015 22:02:58 +0000 (23:02 +0100)]
bdr: Add missing pgstat_report_activity(STATE_IDLE) during apply worker start.
Petr Jelinek [Wed, 4 Feb 2015 19:57:22 +0000 (20:57 +0100)]
bdr: Fix unitialized variable.
Petr Jelinek [Wed, 4 Feb 2015 19:21:49 +0000 (20:21 +0100)]
bdr: Fix initialization of replication identifier emulation.
Andres Freund [Wed, 4 Feb 2015 16:33:13 +0000 (17:33 +0100)]
bdr: Add base structure for sgml documentation.
No meaningful content, but buildable. With index and everything.
Andres Freund [Wed, 4 Feb 2015 15:40:42 +0000 (16:40 +0100)]
bdr: Improve build infrastructure to allow more than one src dir
This is preparation for also building docs; and could also be used to
build bdr_dump.
Petr Jelinek [Wed, 4 Feb 2015 12:41:27 +0000 (13:41 +0100)]
bdr: Always allow temp tables manipulation on UDR provider.
Backpatched from dynconf.
Petr Jelinek [Wed, 4 Feb 2015 12:40:59 +0000 (13:40 +0100)]
bdr: Remove unused variable
Craig Ringer [Wed, 4 Feb 2015 11:29:10 +0000 (22:29 +1100)]
bdr: move extension control files into extsql/
Craig Ringer [Wed, 4 Feb 2015 10:36:32 +0000 (21:36 +1100)]
bdr: stable branch quickstart should prefer bdr-plugin/stable
Craig Ringer [Wed, 4 Feb 2015 10:33:53 +0000 (21:33 +1100)]
bdr: Update the README and INSTALL docs for 0.8.0
Craig Ringer [Sat, 13 Dec 2014 18:45:13 +0000 (02:45 +0800)]
bdr: Add a debug message for DDL replication enqueues
Craig Ringer [Wed, 4 Feb 2015 04:30:29 +0000 (15:30 +1100)]
bdr: All SQL-callable functions should be PGDLLEXPORT
Craig Ringer [Wed, 4 Feb 2015 03:23:45 +0000 (14:23 +1100)]
bdr: Add bdr_version_num() and bdr_min_remote_version_num()
Craig Ringer [Tue, 3 Feb 2015 00:18:27 +0000 (11:18 +1100)]
bdr: Correct parameter types for bdr_get_local_nodeid()
bdr_get_local_nodeid() was returning 'oid' for sysid, but it's a uint64
that won't fit that type's width. Use 'text'.
Andres Freund [Sat, 17 Jan 2015 23:04:46 +0000 (00:04 +0100)]
bdr: Add missing waits in regression tests.
These sometimes caused errors due to not yet released ddl locks.
Andres Freund [Sat, 17 Jan 2015 16:45:00 +0000 (17:45 +0100)]
bdr: Add .gitattribute to enforce a minimum of whitespace consistency.
Also fix some existing damage shown by git log/diff --check
Andres Freund [Sat, 17 Jan 2015 16:29:43 +0000 (17:29 +0100)]
bdr: Fix build logic to work in spite of pg vpath logic changes.
e907997f42faada60e5a26b116cc0b79b69309d1 broke bdr VPATH builds.
Andres Freund [Sat, 17 Jan 2015 16:02:52 +0000 (17:02 +0100)]
bdr: Fix up file headers and copyright dates.
Andres Freund [Fri, 16 Jan 2015 12:32:22 +0000 (13:32 +0100)]
bdr: Fix race between asking for replay confirmation and processing replies.
bdr_process_acquire_ddl_lock() sent out lock requests before being
ready to accept responses. While the window isn't big, it *does*
contain a WAL flush. That can lead to lock acquirations never
finishing because some backend can miss a response to a replay
request.
To fix simply hold the lock appropriately long.