Fully synchronous mode for HDR replication

HDR fully synchronous mode ensures that any transaction committed on a primary server was also committed on the HDR secondary server, which can protects transactional consistency if a failure occurs.

After the primary database server writes the logical-log buffer contents to the HDR buffer, it sends the records from the buffer to the HDR secondary database server. The logical-log buffer flush on the primary database server completes only after the primary database server receives acknowledgment from the HDR secondary database server that the records were received.

To track synchronization, both the primary and HDR secondary server store the following information in their reserved pages:
  • The ID of the logical-log file that contains the last completed checkpoint
  • The position of the checkpoint record within the logical-log file
  • The ID of the last logical-log file that was sent or received
  • The page number of the last logical-log record that was sent or received
To view this information, run the onstat -g dri ckpt command.

Checkpoints between database servers in an HDR replication pair are synchronous. The primary server waits for the HDR secondary server to acknowledge that it received the checkpoint log record before the primary server completes its checkpoint. If the checkpoint does not complete within the time that is specified by the DRTIMEOUT configuration parameter, the primary database server assumes that a failure occurred.

HDR fully synchronous mode has the following requirements:
  • The DRINTERVAL configuration parameter on the primary and HDR secondary server must be set to 0.
  • The DRTIMEOUT configuration parameter on the primary and HDR secondary server must be set to the same value.
Administration can be easier if the operating-system times on the primary and HDR secondary servers are synchronized.
To turn on fully synchronous data replication, set the DRINTERVAL configuration parameter to 0, and then use one of the following methods:
  • Set the HDR_TXN_SCOPE configuration parameter to FULL_SYNC.
  • Run SET ENVIRONMENT HDR_TXN_SCOPE 'FULL_SYNC';

Log records are applied in the order in which they were received. When the log transmission buffer contains many log records, the application of those log records on the HDR secondary server requires more time, and performance can be negatively affected. If this situation occurs, consider using nearly synchronous mode for HDR data replication.