Craig Ringer [Fri, 19 Jun 2015 04:12:03 +0000 (12:12 +0800)]
Fix docs structure errors, a few cleanups
Craig Ringer [Fri, 19 Jun 2015 03:27:22 +0000 (11:27 +0800)]
Remove duplicate conflicts info
Petr Jelinek [Thu, 18 Jun 2015 16:24:01 +0000 (18:24 +0200)]
Add our own function for finding Postgres binaries
We need our own function because the built-in function compares the
binary version including the minor version and since BDR is an extension
it's not realistic to support every possible version combination. The
BDR specific function for finding and validation of Postgres binaries
doesn't do version validation but instead returns major version in the
PG_VERSION_NUM format so it can be easily compared by the caller as
needed.
The pg_dump and pg_restore in bdr_init_replica and pg_ctl and
pg_basebackup check in bdr_init_copy are using the function now.
Petr Jelinek [Thu, 18 Jun 2015 16:22:25 +0000 (18:22 +0200)]
Don't insert node in bdr_init_copy in UDR mode.
Petr Jelinek [Wed, 17 Jun 2015 17:45:19 +0000 (19:45 +0200)]
Fix DROP replay of functions with no parameters.
Craig Ringer [Wed, 17 Jun 2015 06:53:25 +0000 (14:53 +0800)]
Explain that you can't part a node from its self
Craig Ringer [Wed, 17 Jun 2015 06:02:22 +0000 (14:02 +0800)]
Reject attempts to part from self, detect part from absent node
Reject attempts to part a node from its self. This seems like
a sensible thing to do, but we need to remove a node using another
node so that all peers find out about the removal.
Detect when asked to part a nonexistent node and complain instead
of silently doing nothing.
Also warn when asked to part a node that isn't in 'r' state.
Craig Ringer [Wed, 17 Jun 2015 06:02:02 +0000 (14:02 +0800)]
Improve error message on insert/insert multi-unique conflict
Craig Ringer [Tue, 16 Jun 2015 02:37:56 +0000 (10:37 +0800)]
More explanation of conflict types
Ian Barwick [Mon, 15 Jun 2015 07:08:13 +0000 (16:08 +0900)]
doc: fix typo
Petr Jelinek [Fri, 12 Jun 2015 12:18:03 +0000 (14:18 +0200)]
Assertion fixes
Ian Barwick [Fri, 12 Jun 2015 06:46:07 +0000 (15:46 +0900)]
Add documentation for bdr_get_local_nodeid()
Ian Barwick [Fri, 12 Jun 2015 06:38:59 +0000 (15:38 +0900)]
Fix doc references for bdr_get_local_node_name()
Ian Barwick [Fri, 12 Jun 2015 05:19:13 +0000 (14:19 +0900)]
Add missing 'bdr_' prefix
Petr Jelinek [Wed, 3 Jun 2015 18:51:07 +0000 (20:51 +0200)]
Add bdr_unsubscribe()
Petr Jelinek [Thu, 11 Jun 2015 14:12:31 +0000 (16:12 +0200)]
Fix some compiler warnings
Martín Marqués [Sat, 6 Jun 2015 18:30:15 +0000 (15:30 -0300)]
Documentation Typo
Martín Marqués [Wed, 3 Jun 2015 13:31:02 +0000 (10:31 -0300)]
Several documentation corrections
Petr Jelinek [Tue, 2 Jun 2015 19:15:09 +0000 (21:15 +0200)]
Add missing header
Petr Jelinek [Wed, 3 Jun 2015 12:22:26 +0000 (14:22 +0200)]
Change bdr_nodes_get_local_info from SPI to heap scan to avoid starting transaction.
Petr Jelinek [Wed, 3 Jun 2015 11:21:53 +0000 (13:21 +0200)]
Missing extension file
Craig Ringer [Wed, 3 Jun 2015 04:39:57 +0000 (12:39 +0800)]
Document that bdr_initial_load exists but is internal
Closes #76
Craig Ringer [Wed, 3 Jun 2015 04:34:41 +0000 (12:34 +0800)]
Correct --help output for bdr_initial_load
Per report in #76
Petr Jelinek [Tue, 2 Jun 2015 16:20:48 +0000 (18:20 +0200)]
On second thought use session cache for bdr_nodes.
This is how rest of postgres does it. The shmem cache is probably
slightly better performance-wise but it's somewhat abusing the shmem.
The node access API could use some rethinking after this - standard
access should probably go via cache. We should also avoid SPI probably.
But both of these are left for future patches.
In passing activate the read_only regression test which was previously
not added to Makefile by mistake.
Craig Ringer [Tue, 2 Jun 2015 07:25:13 +0000 (15:25 +0800)]
Build instructions changes for UDR
Closes #74
Petr Jelinek [Mon, 1 Jun 2015 20:15:01 +0000 (22:15 +0200)]
Add missing files for previous commit
Petr Jelinek [Sun, 10 May 2015 13:11:40 +0000 (15:11 +0200)]
Add read-only nodes.
Read-only node does not allow writes to permament objects.
Craig Ringer [Tue, 26 May 2015 09:57:46 +0000 (17:57 +0800)]
Upgrade support for 0.9.1.0
Craig Ringer [Tue, 26 May 2015 12:18:37 +0000 (20:18 +0800)]
Release notes for 0.9.1
Craig Ringer [Tue, 26 May 2015 09:51:55 +0000 (17:51 +0800)]
Add bdr.bdr_apply_is_paused() information function
This makes it possible to see whether replay is paused on
a node.
Also adds some tests for pause/resume.
Closes #59
Craig Ringer [Tue, 26 May 2015 07:58:29 +0000 (15:58 +0800)]
doc that bdr.bdr_replicate_ddl_command takes fully qualified name
Closes #70 by documenting that bdr.bdr_replicate_ddl_command requires
fully qualified objects.
Craig Ringer [Tue, 26 May 2015 06:19:37 +0000 (14:19 +0800)]
Update bdr_dump to include setval fixes
Update bdr_dump from bdr-pg/REL9_4_STABLE to include:
3ab2f78 Don't dump setval(...) for 'bdr' sequences
1592812 Only dump non-default sequence access methods
Craig Ringer [Tue, 26 May 2015 06:12:43 +0000 (14:12 +0800)]
Update bdr_dump to 9.4.2 + --snapshot
Update copy of pg_dump with snapshot support for UDR to the
version from bdr-pg/REL9_4_STABLE . We can't use stock pg_dump
because we need support for dumping from a pre-established
snapshot, which is added in the BDR tree.
Petr Jelinek [Tue, 26 May 2015 08:40:38 +0000 (10:40 +0200)]
Add backwards compatibility to the DDL locking
This ensures that DDL locking will work in bdr cross-version environment
for smoother upgrades.
Craig Ringer [Mon, 25 May 2015 14:38:09 +0000 (22:38 +0800)]
fixup! Add update path from 0.9.0.5 to 0.10.0.0
The Makefile.in must also know about the new files
Craig Ringer [Mon, 25 May 2015 05:57:33 +0000 (13:57 +0800)]
Add update path from 0.9.0.5 to 0.10.0.0
commit
401d117, bdr.table_set_replication_sets ...
introduces 0.9.0.5 and we need a path from it to 0.10.0.x.
Andres Freund [Mon, 25 May 2015 01:49:25 +0000 (03:49 +0200)]
bdr: Send pgstat upon replayed commit in apply process.
Previously it was only sent at apply worker shutdown.
Andres Freund [Mon, 25 May 2015 01:43:15 +0000 (03:43 +0200)]
bdr: Improve sequencer locking and pgstat reporting.
Up to now the sequencer locked its relations exclusively to prevent an
interlock with apply. That was problematic, because it would often
prevent auto vacuum/analyze from running, or interrupt it.
Instead of locking the underlying relations lock the bdr seqam object
and add code to apply to also acquire that lock. That allow autovacuum
to run undisturbed.
Testing brought an additional problem to light, namely that pgstat
records weren't sent in the sequencer until shutdown, which means that
in many situations autovacuum won't be trigger in time. This is a more
widespread problem than just the sequencer, but here only the sequencer
is fixed.
Andres Freund [Sun, 24 May 2015 23:46:02 +0000 (01:46 +0200)]
bdr: Adjust database name in debug message.
Andres Freund [Thu, 21 May 2015 21:36:41 +0000 (23:36 +0200)]
bdr: Add minimal checks for the cloning of databases with contents.
These should be expanded, but are better than nothing.
Petr Jelinek [Fri, 22 May 2015 13:40:16 +0000 (15:40 +0200)]
Add the 0.10.0.2 to Makefile
Craig Ringer [Fri, 15 May 2015 09:08:52 +0000 (17:08 +0800)]
bdr.table_set_replication_sets should permit unsafe commands
In
4005c1d bdr_replicate_ddl_command was changed not to override the
command filter, but this broke replication sets in UDR, since they have
to use SECURITY LABEL.
SET bdr.permit_unsafe_ddl_commands on bdr.table_set_replication_sets
since it knows what it's doing.
Fixes #67
Note: The ddl/replication_sets tests cannot be run as-is on UDR because
UDR does not replicate changes to replication sets. We really need
separate tests for this that cover UDR (or BDR+subscribe).
Andres Freund [Thu, 21 May 2015 21:03:30 +0000 (23:03 +0200)]
Don't specify the sequence am in UDR.
The initial cloning needs more tests, including data, but that requires
larger changes to several tests than I want to do in the fix commit
itself.
Fixes #69
Andres Freund [Fri, 15 May 2015 14:03:01 +0000 (16:03 +0200)]
Initial code to actually remove slots when parting a node.
This removes a slot when
a) It is of a remote node that has been parted.
b) We have been parted, and there are remote slots. It is not guaranteed
that we're notified of that case, but it seems worthwhile to handle
nonetheless.
Craig Ringer [Fri, 15 May 2015 09:26:08 +0000 (17:26 +0800)]
fixup! Add a test for node part
Didn't check in the expected/ data
Craig Ringer [Fri, 15 May 2015 09:18:47 +0000 (17:18 +0800)]
Fix UDR after BDRLockType introduction in
10b331fea
Craig Ringer [Fri, 15 May 2015 09:13:26 +0000 (17:13 +0800)]
Better error message if PG_CONFIG is nonsense
Petr Jelinek [Wed, 6 May 2015 14:51:53 +0000 (16:51 +0200)]
Use correct replication set and apply delay config in apply.
Craig Ringer [Wed, 6 May 2015 09:09:59 +0000 (17:09 +0800)]
Add a test for node part
This shows that the slots are currently _not_ correctly dropped.
Petr Jelinek [Tue, 5 May 2015 15:37:50 +0000 (17:37 +0200)]
Use the new lesser form of global lock for some of the DDL commands.
Petr Jelinek [Tue, 5 May 2015 15:35:30 +0000 (17:35 +0200)]
Add support for more levels of global locks.
The old ddl_lock was replaced by ddl_lock and write_lock.
The ddl_lock now only locks database against concurrent DDL but not
against writes anymore. The write_lock locks against writes the same way
old ddl_lock used to. We support upgrading the ddl_lock to write_lock at
some performance penalty (the lock needs to be negotiated again).
Petr Jelinek [Fri, 1 May 2015 13:56:02 +0000 (15:56 +0200)]
Fix broken supervisordb test
Petr Jelinek [Fri, 1 May 2015 13:51:37 +0000 (15:51 +0200)]
Make DML operation wait when there is DDL in progress.
Previously, we immediately raised ERROR when executing DML while DDL
lock was being acquired or held. Now we just keep them waiting until
either the lock is released or statement_timeout kills them.
Update isolation tests accordingly.
Petr Jelinek [Fri, 1 May 2015 13:23:40 +0000 (15:23 +0200)]
Don't immediately kill all transactions when acquiring DDL lock.
Previously we just canceled all transactions in database when acking DDL
lock. This code only cancels transactions which did any writes and gives
them some time (currently hardcoded to 10s) of grace period to finish
what they are doing.
Craig Ringer [Fri, 24 Apr 2015 07:17:40 +0000 (15:17 +0800)]
Prevent users from connecting to bdr_supervisordb
This won't stop bgworkers, but they should hopefully know better.
Craig Ringer [Fri, 24 Apr 2015 06:17:39 +0000 (14:17 +0800)]
Prevent attempts to create/drop/rename bdr_supervisordb
When the BDR extension is loaded, BDR its self can create
bdr_supervisordb, but applications cannot. This gives users
a better error message if they try to drop it, too, e.g.
DROP DATABASE bdr_supervisordb;
ERROR: The BDR extension reserves the database name bdr_supervisordb
for its own use
HINT: Use a different database name
Craig Ringer [Fri, 24 Apr 2015 04:38:26 +0000 (12:38 +0800)]
fixup! Prevent taking the DDL lock without explicit authorization
Per internal discussion, make bdr.permit_ddl_locking true by default.
Petr Jelinek [Thu, 23 Apr 2015 17:18:06 +0000 (19:18 +0200)]
Fix typo in previous commit
Petr Jelinek [Wed, 22 Apr 2015 19:13:34 +0000 (21:13 +0200)]
bdr_init_copy: insert correct bdr_node entry
Petr Jelinek [Wed, 22 Apr 2015 18:57:39 +0000 (20:57 +0200)]
bdr_init_copy: properly escape single quotes
Martín Marqués [Wed, 22 Apr 2015 18:50:02 +0000 (15:50 -0300)]
Typo in bdr_init_copy help information
Martín Marqués [Wed, 22 Apr 2015 18:48:03 +0000 (15:48 -0300)]
Revert "Typo in bdr_init_copy help information"
There was an unintended change in the commit
This reverts commit
1064034c898e98b210a8d87f4a65aa2c05d6666b.
Martín Marqués [Wed, 22 Apr 2015 17:44:17 +0000 (14:44 -0300)]
Typo in bdr_init_copy help information
Craig Ringer [Wed, 22 Apr 2015 09:25:50 +0000 (17:25 +0800)]
fixup! Prevent taking the DDL lock without explicit authorization
Missing <para> in the docs
Craig Ringer [Wed, 22 Apr 2015 06:24:19 +0000 (14:24 +0800)]
Make PG_CONFIG a declared precious configure variable
It'll show up in help and appear in the config cache.
Craig Ringer [Wed, 22 Apr 2015 06:21:19 +0000 (14:21 +0800)]
Fix incorrect AC_ARG_VAR usage, make PATH a precious var with decription
This makes configure consider the PATH important and documents that
it affects where we find pg_config .
Martín Marqués [Tue, 21 Apr 2015 17:42:42 +0000 (14:42 -0300)]
Typo in the docs
Craig Ringer [Tue, 21 Apr 2015 13:10:28 +0000 (21:10 +0800)]
Prevent taking the DDL lock without explicit authorization
Attempts to acquire the global DDL lock will now, by default,
ERROR with a message like:
ERROR: Global DDL locking attempt rejected by configuration
DETAIL: bdr.permit_ddl_locking is false and the attempted command would
require the global DDL lock to be acquired. Command rejected.
HINT: See the 'DDL replication chapter of the documentation.
Users/scripts which wish to execute DDL should:
BEGIN;
SET LOCAL bdr.permit_ddl_locking = true;
ALTER TABLE ....
COMMIT;
This will help prevent accidental DDL in things like user reports
from aborting transactions across the system and blocking user
writes. It's particularly useful where the DDL may be combined
with a transaction that does a large amount of row changes, as
there are performance issues with transactions that both do
DDL and change very large numbers of rows.
Future work will focus on progressively making the DDL lock finer
grained and less disruptive.
Craig Ringer [Tue, 21 Apr 2015 10:52:08 +0000 (18:52 +0800)]
Rename 'bdr' reserved db to 'bdr_supervisordb'
Craig Ringer [Tue, 21 Apr 2015 10:37:44 +0000 (18:37 +0800)]
Fix tests broken by
d7efbe8 and incorrect relation name
Craig Ringer [Tue, 21 Apr 2015 03:05:38 +0000 (11:05 +0800)]
More detail on DDL rep, mention use of replicate_ddl_command
Craig Ringer [Mon, 20 Apr 2015 12:28:06 +0000 (20:28 +0800)]
Clarify that you can only monitor lag from an upstream
Per query from the mailing list,
http://www.postgresql.org/message-id/
F38D1020-3B2C-41CF-BECD-
1F1FB5B19806@visi.com
Craig Ringer [Fri, 17 Apr 2015 07:23:59 +0000 (15:23 +0800)]
More docs on DDL locking
Craig Ringer [Thu, 16 Apr 2015 08:09:24 +0000 (16:09 +0800)]
The apply worker wasn't checking for postmaster death when paused
Fixes #58
Petr Jelinek [Sat, 18 Apr 2015 22:29:07 +0000 (00:29 +0200)]
Make sure node_name is not null and unique.
Petr Jelinek [Sat, 18 Apr 2015 22:11:51 +0000 (00:11 +0200)]
fix bdr_init_copy for UDR
Petr Jelinek [Sat, 18 Apr 2015 22:11:23 +0000 (00:11 +0200)]
pg_upgrade compatibility
Petr Jelinek [Sat, 18 Apr 2015 13:45:25 +0000 (15:45 +0200)]
Beginnings of 9.5 compat (UDR only so far)
Petr Jelinek [Sun, 12 Apr 2015 20:00:35 +0000 (22:00 +0200)]
Correct lock level in filter_AlterTableStmt()
Martín Marqués [Wed, 15 Apr 2015 22:39:44 +0000 (19:39 -0300)]
Missing separation coma in the bdr.bdr_group_join example
Martín Marqués [Wed, 15 Apr 2015 22:37:33 +0000 (19:37 -0300)]
Typo in the docs
Craig Ringer [Wed, 15 Apr 2015 03:39:49 +0000 (11:39 +0800)]
Lower log level of 'Found bdr_connections entry ' log lines
These are internal debug/informational messages.
Craig Ringer [Fri, 10 Apr 2015 05:03:34 +0000 (13:03 +0800)]
Fixes for UNLOGGED tables in the command filter
The command filter was checking only for temporary tables when deciding
whether to skip DDL locking, and when performing some operations, but
for others was permitting UNLOGGED tables too.
Consistently use UNLOGGED||TEMP throughout.
Fixes #44
Petr Jelinek [Wed, 8 Apr 2015 00:04:42 +0000 (02:04 +0200)]
Make bdr_replicate_ddl_command() obey the command filter.
Previously, bdr_replicate_ddl_command() would always execute any
command, no matter if it's considered safe or not. But this behaviour is
too much of a footgun for users of this function. Plus we already have
mechanism to override command filter - the
bdr.permit_unsafe_ddl_commands GUC, so it makes sense that
bdr_replicate_ddl_command() function should behave according to this GUC
just like plain DDL in BDR.
Petr Jelinek [Wed, 8 Apr 2015 00:03:34 +0000 (02:03 +0200)]
Rename locks check interface.
Craig Ringer [Tue, 7 Apr 2015 09:24:40 +0000 (17:24 +0800)]
Document pg_xlog_wait_remote_recieve and pg_xlog_wait_remote_apply
Petr Jelinek [Mon, 6 Apr 2015 14:30:44 +0000 (16:30 +0200)]
Don't acquire table locks in command filter.
The filter_AlterTableStmt() function was using
AlterTableGetLockLevel(astmt->cmds) to determine lock level which to use
on relation being ALTERed. This can cause deadlock against bdr_apply
when the apply is trying to catch up with changes from another node to
synchronize cluster for a DDL lock - any concurrent DML that is coming
from another node will never get the row lock grant because the table is
already locked by the backend performing the ALTER on it.
We now get the relid with NoLock which should be safe as we don't allow
concurrent DDL anyway so the table can't change under our hands.
Petr Jelinek [Fri, 3 Apr 2015 23:45:07 +0000 (01:45 +0200)]
Fix global lock crash recovery on multidb setup
Since bdr_locks_startup() is called from perdb worker we should not try
to load the locks for all databases but only for the database the perdb
worker is connected to.
Petr Jelinek [Wed, 1 Apr 2015 20:26:59 +0000 (22:26 +0200)]
doc: Fix typos in function names.
Petr Jelinek [Wed, 1 Apr 2015 16:45:54 +0000 (18:45 +0200)]
Fix bdr.bdr_replication_identifier table definition
The bdr.bdr_replication_identifier was mistakenly defined in extension
SQL file with two additonal columns, but the C code didn't expect them
this lead to memory corruption. It was identified by make check failures
with clang compiler.
Craig Ringer [Wed, 1 Apr 2015 07:28:15 +0000 (15:28 +0800)]
Swap "node management" and "configuration settings" chapters
Per suggestion from Martín.
Closes #38
Craig Ringer [Wed, 1 Apr 2015 06:55:07 +0000 (14:55 +0800)]
Quickstart should be using bdr-plugin/next
Petr Jelinek [Sun, 29 Mar 2015 14:09:47 +0000 (16:09 +0200)]
doc: Print BDR version in the title.
Petr Jelinek [Sun, 29 Mar 2015 13:38:16 +0000 (15:38 +0200)]
doc: Add optinal website-build flag
Petr Jelinek [Fri, 27 Mar 2015 21:50:13 +0000 (22:50 +0100)]
doc: Make the font bit nices
Martín Marqués [Fri, 27 Mar 2015 11:04:00 +0000 (08:04 -0300)]
Several "to to" typos found, which are now fixed.
Petr Jelinek [Thu, 26 Mar 2015 17:00:03 +0000 (18:00 +0100)]
Fix identifier test so that it works for UDR too.
Petr Jelinek [Thu, 26 Mar 2015 16:58:06 +0000 (17:58 +0100)]
Revert inadvertent test change done in
d8fc209d5
Petr Jelinek [Thu, 26 Mar 2015 11:29:19 +0000 (12:29 +0100)]
doc: Remove mentions of bdr-plugin/stable branch from docs
Craig Ringer [Thu, 26 Mar 2015 02:40:07 +0000 (10:40 +0800)]
Document tree structure for github README