Slony-I is a "master to multiple slaves" replication system supporting cascading (e.g. - a node can feed another node which feeds another node...) and failover.

The big picture for the development of Slony-I is that it is a master-slave replication system that includes all features and capabilities needed to replicate large databases to a reasonably limited number of slave systems.

Slony-I is a system designed for use at data centers and backup sites, where the normal mode of operation is that all nodes are available.

A fairly extensive "admin guide" comprising material in the CVS tree may be found here. There is also a local copy.

The original design document is available here.

People frequently ask for assistance in figuring out what might be wrong with their cluster. The first thing that you should do if you think there might be a problem (or even if you don't) is to run the test state scripts. That may help point you to where the problem is; it may also help point other would-be helpers to where the problem is.

If you're not running these scripts hourly against your cluster(s), you really should be...

Version 1.2.13 is now available. See the "news" area for more details, including a copy of the release notes.

There is a known incompatibility of versions earlier than 1.1.5 with version 8.1; you can expect to see the following error message when compiling:

slony1_funcs.c:1081: error: too many arguments to function `Async_Unlisten'

A patch for both version 1.1 "STABLE" and CVS HEAD has been committed to CVS; look at both CVS HEAD as well as REL_1_1_STABLE. It is in the 1.1.5 release candidate described above.

Beginning with version 1.0.5 the slon replication engine refuses to work against any database that does not have the stored procedures for the same version loaded or where the shared object containing the C language support functions and the log trigger does not match the version number.

This means that the Slony installation on all nodes in a cluster must be upgraded at once.

The proper upgrade procedure is this:

  1. Stop the slon replication engine on all nodes.
  2. Install the new Slony version on all nodes.
  3. Execute a slonik script containing the command
    
        update functions (id = );
    
    for every node in the cluster.
  4. Start all slon replication engines.

For more details, see also Upgrading Slony-I .

Slony-1 1.2.13 engine documentation
Slony-1 1.1.9 engine
Chris Browne 2007-06-26
A provisional candidate for 1.2.14 has been made available. Changes include:
  • Fix typo in configure-replication.sh (missing CR)
  • Per bug #35, search the Slony share dir for scripts before falling back to the PG share dir on 8.0+

    This has resulted in quite a lot of discussion on bug #35; we need agreement that this change is an apropos way to go...

  • Change test framework to write out the test name into $TEMPDIR/TestName
  • Patch that seems to resolve a race condition with ACCEPT_SET

    See: email by Yoshiharu Mori

    See also CVS commit note .

    This particular change has not yet seen heavy verification/testing; please examine it carefully.

Chris Browne 2008-03-07
Vivek Khera observed that the documentation tarball did not include .png files or man pages; added this in, and rebuilt the tarball.

There is no change to the source code tarball.

Chris Browne 2008-02-29
  • Fixed problem with compatibility with PostgreSQL 8.3; function typenameTypeId() has 3 arguments as of 8.3.

    This now allows Slony-I to work with the PostgreSQL 8.3.0 release.

  • Added in logic to ensure that max # of SYNCs grouped together is actually constrained by config parameter sync_group_maxsize.
  • Fix to show_slony_configuration - point to proper directory where slon/slonik are actually installed.
  • Fix to slonik Makefile + slonik.c - Change slonik build to query Postgres for the share directory at runtime - per Dave Page
  • Removed spurious NOTIFY on "_%s_Confirm"; this is no longer needed in the 1.2 branch, as there is no LISTEN on this notification. Noted in bug #32
Chris Browne 2008-02-09

Many thanks to Command Prompt staff for installing and configuring a Bugzilla instance for use in tracking Slony-I bugs and feature requests.

Feature and bug lists will be migrating into this over the next little while...

Christopher Browne 2007-11-13

Version 1.2.12 is now released

  • Fixed problem with DDL SCRIPT parser where C-style comments were not being processed properly
  • Added stored functions and documentation for adding empty tables (notably *partitions*) to replication. Note these functions do no work when not specifically requested. CAVEAT: This functionality may not work as expected on versions of PostgreSQL earlier than 8.1. Mind you, partitioning tends to function pretty poorly in earlier versions of PostgreSQL as there were substantial enhancements in 8.1 and following versions.
  • Added a fairly substantial partitioning test to exercise the new stored functions above.
  • Backport "listen path" generator function from CVS HEAD (2.0) to 1.2 branch.
  • Fixed a problem with "EXECUTE SCRIPT" (introduced in remote_worker.c version 1.124.2.13) where moving the relevant code into a subroutine at the end led to losing the "BEGIN; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;" query that needs to be the first thing run...
  • Fixing the archive sequence generations (in log shipping). All non-SYNC events must start the local transaction before creating the archive as well, so that the lock on the archive counter table serializes archive creation.
  • Fixed logging done in local_listener.c - various places, there was no '\n' in some cases, which would lead to entries being folded together.
  • Fix launch_slons.sh - was not stripping quotes from PID file name
  • Error handling for "ERROR: could not serialize access due to concurrent update"

    If this error is encountered when starting processing of sl_archive_counter, then two threads are fighting over access to this counter, and at least one has just failed.

    Rather than waiting, we ask to restart the node immediately.

  • Fixes to slonik_build_env script - it wasn't properly handling cases where there was just 1 table or 1 sequence, and had a problem with the -schema option - thanks, Bernd Helmle
  • Don't bother building slony_logshipper on Win32 as it doesn't work there at this point.
  • If slonik connects as other than a superuser, then generate error message indicating this to the user.
Christopher Browne 2007-11-12
We are pleased to announce general availability of Slony-I 1.2.11.

Fixes are the following:

  • Add in tools/mkservice scripts previously added to CVS HEAD
  • During subscription, do UPDATE to pg_class.relhasindex *after* the TRUNCATE because, in 8.2+, TRUNCATE resets this attribute
  • Fixed a problem with the setsync tracking with Log Shipping in cases where slon does an internal restart (thereby rereading the pset.ssy_seqno) and ignoring non-SYNC events because those don't change the sl_setsync table.
  • More explicit type casting of text objects for compatibility with PostgreSQL 8.3
  • Fixed problem with DDL SCRIPT statement parser: it wasn't 'quoting' semicolons inside parentheses (this notably occurs in CREATE RULE).
  • Fixed problem with DDL SCRIPT statement submission; it was interpreting the statement as a format string, which would have ill effects in the presence of things that are interpreted such as format strings (%d, %f, %s) and \backslashed things like \\, \n.
  • Further DDL Script issue: non-terminated statement at the end (e.g. - without trailing semicolon ";") would get omitted.
  • Typo fix: when trying to disable a node, the logs would report "enableNode" rather than "disableNode". Fixed.
  • Add usage/version options to help output in slon.
  • Fix archive logging for replicated sequences.
  • Fix to log shipping - added another table, sl_archive_counter where the log writing slon simply tracks when it wrote the last offline archive file and maintains a counter. This counter is now tracked in the offline replica and must increment gap free.
  • Change the filenames of archive logs to be based on internal archive tracking number. This makes it easy for the mechanism applying archives to figure out what needs to be applied next - just look in sl_archive_tracking.
  • Fix log shipping test to accomodate the new tracking scheme, and update documentation to describe this better.
Christopher Browne 2007-08-28
RPM "spec" files are a part of the Slony-I build; if you require RPMs for your flavour of RPM-based distribution, try building Slony-I thus:
./configure
make rpm
For systems reasonably similar to Fedora and RHAS, this will generate .rpm files that will be compatible with your system.
Devrim Gunduz 2007-06-28
Ismail Yenigul has made available documentation written in Turkish in StarOffice Writer format or PDF .
Ismail Yenigul 2007-06-27
Slony-I 1.2.10 has been built for Windows; binaries are available here.
Hiroshi Saito 2007-06-27
We are pleased to announce the release of Slony-I version 1.2.10. Sources as well as pre-built documentation is available in the download area; users of RPM-based systems and Windows will likely see suitable packages soon.
Chris Browne 2007-06-26