Product Documentation

FairCom DB V12 Updates

Previous Topic

Next Topic

Synchronous Replication for High Availability

FairCom Server V12 and later support both asynchronous and synchronous replication for c-tree data files under full transaction control. The new Synchronous Replication Agent can better address cases where high availability is crucial:

  • A failover environment, where the secondary (target) server must be always in sync with the primary (source) server.
  • Cases where no committed transaction can be lost while moving from the primary to the secondary server.
  • Cases where no delays are acceptable while moving to the secondary server.

With Replication Manager, the user can choose between synchronous and asynchronous replication when setting up replication plans.

Note: Depending on the synchronous replication mode selected, it is possible update operations may experience performance penalties.

Requirements

Synchronous replication requires files to have replication support enabled, which means they must meet the same requirements for data replication as previous asynchronous replication did:

  1. the file must have a unique index
  2. the file must be under full transaction control
  3. the file must be marked for replication

Enabling Synchronous Replication with Replication Manager

When configuring replication, the Replication Manager browser-based application has a check box that allows a replication mode to be enabled as either Synchronous or Asynchronous. The replication mode can be set on a per-plan basis.

Enabling Synchronous Replication with Replication Agent

To enable synchronous replication for a file, follow these steps:

  1. Set up a Synchronous Replication Agent. This involves creating a Replication Agent configuration file that includes the option syncagent yes and using the repadm utility to register the unique ID of the Replication Agent with the source server. For example, if the source server name is FAIRCOMS@source_hostname, and the Replication Agent unique ID is AGENT1, the following command registers this agent ID with this source server (note that replication agent IDs are not case sensitive):

    C:\> repadm -c addsyncagent agent1 -s FAIRCOMS@source_hostname

    FairCom DB(tm) Version 12.0.81 (Build-201020) Replication Agent Management Utility

    Copyright (C) 1992 - 2020 FairCom Corporation

    ALL RIGHTS RESERVED.

    Successfully added synchronous replication agent 'agent1'

  2. Use the repadm utility to enable synchronous replication for the data file on the source server. Note that the data file must exist for this operation to succeed. Example:

    C:\> repadm -c addsyncagentfilemap mark.dat agent1 -s FAIRCOMS

    FairCom DB(tm) Version 12.0.81 (Build-201020) Replication Agent Management Utility

    Copyright (C) 1992 - 2020 FairCom Corporation

    ALL RIGHTS RESERVED.

    Successfully added mapping to synchronous replication agent 'agent1' for file 'mark.dat'

    It is possible to enable synchronous replication for a data file on more than one secondary server. Simply create a synchronous replication agent for each secondary server and repeat the above steps for each replication agent.

    After these steps have been successfully completed, the commit of any transaction that updates the specified file will wait for notification from the replication agent(s) that the transaction has been processed.

  3. Add the following option to the Replication Agent configuration file, ctreplagent.cfg, and start the replication agent:

    syncagent yes

    When this option is specified, the Replication Agent operates as a synchronous agent, sending notification of its commit position to the primary server.

Note that for a Replication Agent to successfully connect to a source server as a synchronous agent, its unique ID must have already been registered with the source server. Otherwise, the connection fails with error 101 and the following messages are logged to ctreplagent.log:

Failed to update commit position on source server: 101

Check that this replication agent's ID (<agentid>) is registered as a synchronous replication agent on the source server

Synchronous replication state files on source server:

The source server creates the following tables to support synchronous replication:

Compatibility Notes:

To use this feature, the source and target servers and the Replication Agent must all include support for it. A new Replication Agent could work with old servers as long as it’s not configured to use synchronous replication.

A field was added to the snapshot structure, so the system snapshot version has increased from 21 to 22. This field’s value is displayed in SNAPSHOT.FCS for a text snapshot. The snapshot parse utility, ctsnpr, has been updated to handle this new SNAPSHOT.FCS format.

TOCIndex