Requirements and Restrictions v6.2

The following are the general requirements and restrictions when using the log-based method for any database of a single-master or multi-master replication system:

  • The selection of either the trigger-based method or the log-based method is a characteristic applicable to only the publication database. The choice is made when defining the primary database of a single-master replication system (see Section Adding a Publication Database) or the primary definition node of a multi-master replication system (see Adding the Primary definition node).
  • The logical decoding feature, and hence the log-based method, is supported beginning with PostgreSQL version 9.4. Therefore, in order to use the log-based method for a publication database, that publication database must be running under PostgreSQL version 9.4 or later, or under Advanced Server version 9.4 or later.
  • In a single-master replication system, whether the primary database uses the trigger-based method or the log-based method has no additional impact on the rules for choosing the subscription database. For example, even if the log-based method is chosen for the primary database, the subscription database may be running on Postgres version 9.4 as well as any supported, earlier version of Postgres, as well as Oracle or SQL Server.
  • In a single-master replication system, the primary database may contain one or more publications (that is, named sets of tables for replication). This is applicable to a primary database using either the trigger-based method or the log-based method.
  • It is permissible to have multiple, single-master replication systems running under a publication server where some primary databases may use the trigger-based method while others use the log-based method.
  • In a multi-master replication system, the selection of either the trigger-based method or the log-based method on the primary definition node determines the method for all other primary nodes. In other words, if the trigger-based method is chosen for the primary definition node, then all other primary nodes will use the trigger-based method. If the log-based method is chosen for the primary definition node, then all other primary nodes will use the log-based method.
  • As a consequence of the restriction described in the preceding bullet point, in order to use the log-based method for a multi-master replication system, all of the primary nodes of the system must be running under Postgres version 9.4 or later, and all such Postgres database clusters must be configured to use logical decoding for the log-based method.

Selection of the log-based method for any database impacts the configuration of the Postgres database cluster containing that database.

If you plan to use the log-based method with any publication database running under a Postgres database server, the following configuration parameter settings are required in the configuration file, postgresql.conf, of that Postgres database server:

  • wal_level. Set to logical.
  • max_wal_senders. Specifies the maximum number of concurrent connections (that is, the maximum number of simultaneously running WAL sender processes). Set at minimum, to the total number of primary databases of single-master replication systems and primary nodes of multi-master replication systems on this database server that will use the log-based method.
  • max_replication_slots. Specifies the maximum number of replication slots. If the database server supports both single-master replication systems and multi-master replication systems, then max_replication_slots must be set at minimum to the sum of the requirements for both replication systems. For support of SMR systems, the minimum requirement is the total number of primary databases of the single-master replication systems that will use the log-based method. For support of MMR systems, the minimum requirement is the total number of primary nodes in the multi-master replication system multiplied by the number of primary nodes residing on this database server. For information, see Replication Origin.
  • track_commit_timestamp. Set to on. This configuration parameter applies only to Postgres database servers of version 9.5 and later. See Configuration Parameter and Table Setting Requirements for additional information.

Also, see Enabling Synchronization Replication with the Log-Based Method for setting these parameters for a single-master replication system. See Enabling Synchronization Replication with the Log-Based Method for a multi-master replication system.

In addition, the pg_hba.conf configuration file of the Postgres database server must contain an entry permitting REPLICATION access for each database using the log-based method running on the database server. The access must be permitted to the publication database user specified when creating the publication database definition using the xDB Replication Console (See Adding a Publication Database for a single-master replication system or Adding the Primary definition node for a multi-master replication system) or the xDB Replication Server Command Line Interface (CLI) (see Adding a Publication Database (addpubdb)).

See Postgres Server Authentication for setting REPLICATION access for a single-master replication system. See Verifying Host Accessibility for a multi-master replication system.

For configuration options in the publication server configuration file that are specifically applicable to the log-based method see Log-Based Method of Synchronization Options.