Replication give-up#
Overview#
This section explains the potential GIVE-UP phenomenon that may occur during replication and the impact of replication GIVE-UP.
Version#
- Altibase 6.1.1 or later
Replication and log files#
Altibase replication is a data synchronization feature based on Redo logs.
In other words, it ensures data consistency between the Active Server and the Standby Server by transferring the Redo logs generated on the Active Server to the Standby Server.
In Altibase, Redo log files are not managed using a fixed number of circularly reused files. Instead, logs are generated without a limit as transactions are processed, and once a log file's checkpoint has completed, the log file is deleted as part of a cleanup process.
This cleanup occurs when a checkpoint is performed. Redo log files that meet any of the following conditions cannot be deleted:
- Log files that contain a currently active transaction
- Log files that have not yet been transferred for replication (i.e., log files remaining due to a replication gap)
- Log files referenced by CLR (Compensation Log Record, a type of log record created during transaction rollback) logs
- Log files for which archiving has not yet completed
If Redo log files meeting one or more of the above conditions are not cleaned up and continue to accumulate, a disk-full failure may eventually occur on the Active Server.
Replication give-up#
If Redo log files are not cleaned up due to a replication issue, a disk-full failure may occur.
To prevent this, you can configure the maximum number of Redo log files that replication can retain by using the REPLICATION_MAX_LOGFILE property.
If the current number of Redo log files exceeds the value configured for this property, the system abandons the replication gap and deletes the Redo log files—even if the data has not been synchronized to the Standby Server—in order to prevent a disk-full failure on the Active Server.
This phenomenon, where Redo log files that have not completed replication synchronization are deleted to prevent a disk-full failure on the Active Server, is called replication GIVE-UP.
Effect of give-up occurrence#
When replication GIVE-UP occurs, data inconsistency between the Active Server and the Standby Server may occur.
How to prevent give-up#
- To prevent replication GIVE-UP, network performance, which can affect replication performance, must be kept stable.
-
Even in abnormal situations (power outages, network disconnections, etc.), set the REPLICATION_MAX_LOGFILE property to a sufficiently large value so that replication GIVE-UP does not occur.
When doing so, take disk capacity and available space into account so that a disk-full failure does not occur on the Active Server.-
Example
REPLICATION_MAX_LOGFILE = 400 -
If the number of accumulated Redo log files reaches or exceeds the value configured for this property, replication GIVE-UP is triggered.
- The unit of this property is the number of Redo log files.
- This property can be modified in the
$ALTIBASE_HOME/conf/altibase.propertiesfile.
-
Set whether replication restarts after give-up occurs#
After replication GIVE-UP occurs due to exceeding the value set for the REPLICATION_MAX_LOGFILE property, you can use the property below to configure how replication restarts.
REPLICATION_SENDER_START_AFTER_GIVING_UP = 1 (default)
When set to 0
- When replication GIVE-UP occurs, the
IS_STARTEDcolumn value in theSYS_REPLICATIONS_metadata table changes to0. - The replication "Restart SN" value (i.e., the
XSNcolumn value in theSYS_REPLICATIONS_table) is reset to-1, and replication stops.
In this case, because replication has been reset, log files are no longer prevented from being deleted due to replication.
When set to 1
- The replication "Restart SN" value changes to the last (largest) SN of the current log file, and replication resumes synchronization from that "Restart SN."
In other words, replication synchronization resumes from the current point in time.
Cycle#
Whether or not the replication GIVE-UP mechanism is triggered is determined during the execution of a checkpoint, which is when Redo log file cleanup occurs.
Check whether give-up has occurred#
When a replication GIVE-UP occurs, the GIVE-UP time is recorded in the SYSTEM_.SYS_REPLICATIONS_ metadata table.
iSQL> set vertical on;
iSQL> select replication_name, is_started, give_up_time from SYSTEM_.SYS_REPLICATIONS_;
REPLICATION_NAME : REP1
IS_STARTED : 1
GIVE_UP_TIME :
1 row selected.
| Column | Description |
|---|---|
| REPLICATION_NAME | Replication name |
| IS_STARTED | Whether replication has started (1: start, 0: stop) |
| GIVE_UP_TIME | The date and time when replication GIVE-UP most recently occurred |