Skip to main content

Synchronous replication for reliable availability

Asynchronous replication is fast because it does not wait for the secondary server or the network. Synchronous replication is somewhat slower because it ensures both servers have persisted a transaction before reporting that the transaction has been committed. Synchronous replication is required for high availability because only it can guarantee data is always the same on both servers at all points in time. For more details about these two types of replication, see Asynchronous or synchronous replication.

Figure 1. Enable synchronous replication
Enable synchronous replication

Synchronous replication is enabled at the plan level.



Manual configuration

Enable synchronous replication

Enable the Replication Agent for immediately consistent replication with the following configuration in ctreplagent.cfg.

syncagent yes

Specify files for synchronous replication

Add data files to the list of files to replicate. Data files must exist before adding them to the list. This list is provided as an XML file.

<?xml version="1.0" encoding="us-ascii"?>
<replfilefilter version="1" persistent="y">
   <file status="include">./mark.dat</file>
   <file status="include">./deposits.dbs/*.dat</file>
   <file status="include">./ctreeSQL.dbs/*.dat</file>
   <file status="include">./ctreeSQL.dbs/SQL_SYS/ctreeSQL.fdd*</file>
   <file status="include">./deposits.dbs/*.fdd</file>
   <purpose>create_file</purpose>
   <purpose>read_log</purpose>
   <purpose>open_file</purpose>
   <purpose>sync_commit</purpose>
</replfilefilter>

Note

<purpose> is set to "sync_commit" to enable sychronous replication.

This file definition is provided to ctreplagent.cfg with the following entry.

file_filter <../config/replication/filter1.xml

This information resides in the REPLSYNCDT2.FCS file on the source server. It is a mapping of files that are associated with agents for that server to coordinate log maintenance.

If you experience an error 2 in this operation, it means the file is already registered as synchronous control and exists in the state folder (error 2 is KDUP_ERR, a duplicate key).