Prerequisites
A persistent memory-optimized instance of minor version 1.2.4 or later is created.
Note
The synchronization mode cannot be changed for persistent memory-optimized instances of earlier minor versions. For information about how to update the minor version of an instance, see Update the minor version of an instance.
Synchronization mode overview
Open source Redis uses the asynchronous replication mechanism for data synchronization between the master and replica nodes. In this mode, after the master node processes a request and returns the response to the client, the system synchronizes data from the master node to the replica node. In this case, if a master-replica switchover is triggered by an instance failure, data inconsistency may occur between the master and replica nodes.
In semi-synchronous replication mode, after the master node processes a request, the system synchronizes logs from the master node to the replica node. The master node does not respond to the client until the master node receives a success response from the replica node. This way, data consistency is ensured even if a master-replica switchover occurs.
The following figure shows how these two modes work.
Precautions
When you enable or disable semi-synchronous replication for a persistent memory-optimized instance, full data replication is triggered between the master and replica nodes. We recommend that you perform the operation during off-peak hours.
Procedure
Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.
In the upper-right corner of the Basic Information section, click Change Synchronization Mode.
In the panel that appears, configure the parameters that are described in the following table.
Parameter | Description |
Synchronization Mode | Default value: Asynchronous. Valid values: |
Degradation Threshold | This parameter is available only if you set Synchronization Mode to Semi-Synchronous. Unit: ms. Valid values: 10 to 60000. Default value: 500. If the latency of data synchronization between the master and replica nodes exceeds the threshold, the synchronization mode is automatically changed to Asynchronous. After the latency decreases to a value lower than the threshold, the synchronization mode is automatically changed back to Semi-Synchronous. |
Click OK.